shithub: freetype+ttf2subf

Download patch

ref: e8a5c33e9f7d07fc39315a8d2c88c632e4fa4f28
parent: 3d167cbe7f672208f4197237945d52a4356de420
author: Werner Lemberg <[email protected]>
date: Thu Nov 27 01:48:37 EST 2014

* src/tools/docmaker/sources.py (re_bold, re_italic): Use
non-grouping parentheses.
* src/tools/docmaker/tohtml.py (HtmlFormatter::make_html_word):
Updated.

git/fs: mount .git/fs: mount/attach disallowed
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,12 @@
 2014-11-27  Werner Lemberg  <[email protected]>
 
+	* 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  <[email protected]>
+
 	* src/base/ftobjs.c (FT_Get_Glyph_Name): Fix compiler warning.
 
 	Introdruced in previous change.  Reported by Alexei.
--- a/src/tools/docmaker/sources.py
+++ b/src/tools/docmaker/sources.py
@@ -147,13 +147,13 @@
 
 #
 # 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
--- a/src/tools/docmaker/tohtml.py
+++ b/src/tools/docmaker/tohtml.py
@@ -263,13 +263,13 @@
         m = re_italic.match( word )
         if m:
             name = m.group( 1 )
-            rest = m.group( 3 )
+            rest = m.group( 2 )
             return '<i>' + name + '</i>' + rest
 
         m = re_bold.match( word )
         if m:
             name = m.group( 1 )
-            rest = m.group( 3 )
+            rest = m.group( 2 )
             return '<b>' + name + '</b>' + rest
 
         return html_quote( word )