- Commit
- 06138ad4c2b0246506dc5e4b406d0e9650427beb
- Parent
- 8b44dab7b3465445ac4137dc7893665f2336024b
- Author
- John MacFarlane <jgm@berkeley.edu>
- Date
Fixed make_man_page.py so it works with both python2 and python3.
Closes #251.
My personal build of CMark ✏️
Fixed make_man_page.py so it works with both python2 and python3.
Closes #251.
1 file changed, 7 insertions, 1 deletion
Status | File Name | N° Changes | Insertions | Deletions |
Modified | man/make_man_page.py | 8 | 7 | 1 |
diff --git a/man/make_man_page.py b/man/make_man_page.py @@ -34,7 +34,13 @@ render_man.restype = c_char_p render_man.argtypes = [c_void_p] def md2man(text): - return render_man(parse_document(text, len(text))) + if sys.version_info >= (3,0): + textbytes = text.encode('utf-8') + textlen = len(textbytes) + else: + textbytes = text + textlen = len(text) + return render_man(parse_document(textbytes, textlen)) comment_start_re = re.compile('^\/\*\* ?')