diff --git a/Makefile b/Makefile index 05895f74e..0de726ba9 100644 --- a/Makefile +++ b/Makefile @@ -116,7 +116,7 @@ mingw: $(MAKE) && $(MAKE) install man/man3/cmark.3: src/cmark.h | $(CMARK) - python man/make_man_page.py $< > $@ \ + python3 man/make_man_page.py $< > $@ \ archive: git archive --prefix=$(RELEASE)/ -o $(RELEASE).tar.gz HEAD diff --git a/man/make_man_page.py b/man/make_man_page.py index 86a27f3fb..2115411bc 100644 --- a/man/make_man_page.py +++ b/man/make_man_page.py @@ -47,19 +47,19 @@ def md2man(text): textlen = len(text) return render_man(parse_document(textbytes, textlen), 0, 72) -comment_start_re = re.compile('^\/\*\* ?') -comment_delim_re = re.compile('^[/ ]\** ?') -comment_end_re = re.compile('^ \**\/') -function_re = re.compile('^ *(?:CMARK_EXPORT\s+)?(?P(?:const\s+)?\w+(?:\s*[*])?)\s*(?P\w+)\s*\((?P[^)]*)\)') -blank_re = re.compile('^\s*$') -macro_re = re.compile('CMARK_EXPORT *') -typedef_start_re = re.compile('typedef.*{$') -typedef_end_re = re.compile('}') -single_quote_re = re.compile("(?(?:const\s+)?\w+(?:\s*[*])?)\s*(?P\w+)\s*\((?P[^)]*)\)') +blank_re = re.compile(r'^\s*$') +macro_re = re.compile(r'CMARK_EXPORT *') +typedef_start_re = re.compile(r'typedef.*{$') +typedef_end_re = re.compile(r'}') +single_quote_re = re.compile(r"(?**', re.sub(single_quote_re, '*\g<1>*', s)) + return re.sub(double_quote_re, r'**\g<1>**', re.sub(single_quote_re, r'*\g<1>*', s)) typedef = False mdlines = []