- Commit
- 34840a77d3cb48d2d7490b7cce95d7cdd66cc510
- Parent
- 5a7a3e829a9a62f51bbd49e1ef4256a64d1f2493
- Author
- John MacFarlane <jgm@berkeley.edu>
- Date
wrapper.rb: properly calculate length of string in bytes.
My personal build of CMark ✏️
wrapper.rb: properly calculate length of string in bytes.
1 file changed, 2 insertions, 1 deletion
Status | File Name | N° Changes | Insertions | Deletions |
Modified | wrapper.rb | 3 | 2 | 1 |
diff --git 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());