From 34840a77d3cb48d2d7490b7cce95d7cdd66cc510 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Wed, 12 Nov 2014 19:28:59 -0800 Subject: wrapper.rb: properly calculate length of string in bytes. --- wrapper.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'wrapper.rb') 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()); -- cgit v1.2.3