diff --git a/ChangeLog b/ChangeLog index f406b9cf8..0ab5e47a4 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2014-11-27 Werner Lemberg + + * src/tools/docmaker/sources.py (re_bold, re_italic): Use + non-grouping parentheses. + * src/tools/docmaker/tohtml.py (HtmlFormatter::make_html_word): + Updated. + 2014-11-27 Werner Lemberg * src/base/ftobjs.c (FT_Get_Glyph_Name): Fix compiler warning. diff --git a/src/tools/docmaker/sources.py b/src/tools/docmaker/sources.py index 61af985ea..d60fd4464 100644 --- a/src/tools/docmaker/sources.py +++ b/src/tools/docmaker/sources.py @@ -147,13 +147,13 @@ re_crossref = re.compile( r'@((?:\w|-)*)(.*)' ) # @foo # # Two regular expressions to detect italic and bold markup, respectively. -# Group 1 is the markup, group 3 the rest of the line. +# Group 1 is the markup, group 2 the rest of the line. # # Note that the markup is limited to words consisting of letters, digits, # the character `_', or an apostrophe (but not as the first character). # -re_italic = re.compile( r"_(\w(\w|')*)_(.*)" ) # _italic_ -re_bold = re.compile( r"\*(\w(\w|')*)\*(.*)" ) # *bold* +re_italic = re.compile( r"_(\w(?:\w|')*)_(.*)" ) # _italic_ +re_bold = re.compile( r"\*(\w(?:\w|')*)\*(.*)" ) # *bold* # # This regular expression code to identify an URL has been taken from diff --git a/src/tools/docmaker/tohtml.py b/src/tools/docmaker/tohtml.py index 2e44f848b..8861633df 100644 --- a/src/tools/docmaker/tohtml.py +++ b/src/tools/docmaker/tohtml.py @@ -263,13 +263,13 @@ class HtmlFormatter( Formatter ): m = re_italic.match( word ) if m: name = m.group( 1 ) - rest = m.group( 3 ) + rest = m.group( 2 ) return '' + name + '' + rest m = re_bold.match( word ) if m: name = m.group( 1 ) - rest = m.group( 3 ) + rest = m.group( 2 ) return '' + name + '' + rest return html_quote( word )