summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2014-11-12 19:28:59 -0800
committerJohn MacFarlane <jgm@berkeley.edu>2014-11-12 19:28:59 -0800
commit34840a77d3cb48d2d7490b7cce95d7cdd66cc510 (patch)
treed4af2d77c369a50dd16a9fad9e8398321fe37392
parent5a7a3e829a9a62f51bbd49e1ef4256a64d1f2493 (diff)
wrapper.rb: properly calculate length of string in bytes.
-rw-r--r--wrapper.rb3
1 files changed, 2 insertions, 1 deletions
diff --git a/wrapper.rb b/wrapper.rb
index 3ec2186..e7e515c 100644
--- a/wrapper.rb
+++ b/wrapper.rb
@@ -7,7 +7,8 @@ module CMark
end
def markdown_to_html(s)
- CMark::cmark_markdown_to_html(s, s.length)
+ len = s.bytes.length
+ CMark::cmark_markdown_to_html(s, len)
end
print markdown_to_html(STDIN.read());