aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2014-11-25 23:54:45 -0800
committerJohn MacFarlane <jgm@berkeley.edu>2014-11-25 23:54:45 -0800
commitf7613e98edbb8987e0e0ecfb3c789c7ee8d60017 (patch)
tree1ef7b72b7483126438d8b55f07a13426dac6f64c
parent7191f6b7791b284c2d8d898e6e332a190367baa7 (diff)
Added wrapper.rb.
-rwxr-xr-x[-rw-r--r--]wrapper.rb6
1 files changed, 3 insertions, 3 deletions
diff --git a/wrapper.rb b/wrapper.rb
index e7e515c..59a9b87 100644..100755
--- a/wrapper.rb
+++ b/wrapper.rb
@@ -1,3 +1,4 @@
+#!/usr/bin/env ruby
require 'ffi'
module CMark
@@ -7,9 +8,8 @@ module CMark
end
def markdown_to_html(s)
- len = s.bytes.length
+ len = s.bytesize
CMark::cmark_markdown_to_html(s, len)
end
-print markdown_to_html(STDIN.read());
-
+STDOUT.write(markdown_to_html(ARGF.read()))