]> git.donarmstrong.com Git - lilypond.git/commitdiff
texi2html: Fix translation of section titles
authorReinhold Kainhofer <reinhold@kainhofer.com>
Mon, 7 Apr 2008 08:33:39 +0000 (10:33 +0200)
committerReinhold Kainhofer <reinhold@kainhofer.com>
Mon, 7 Apr 2008 08:33:39 +0000 (10:33 +0200)
texi2html inserts a whitespace at the beginning and the end of a
section title, i.e. "<h1> Chapter blah </h1>", while makeinfo didn't
use a space "<h1>Chapter blah</h1>". Update the regexp that extracts
the section titles accordingly to allow spaces right after <h\d> and
before </h\1>...

buildscripts/html-gettext.py

index 65efe8f28396637b75ffd2f2fea7655632205066..7b381349b56fc4cd8a59b66b714382e9c5713ecd 100644 (file)
@@ -88,7 +88,7 @@ for filename in args[3:]:
        page = re.sub (r'<title>([^<]*?) - ([^<]*?)</title>', title_gettext, page)
        # ugh
        page = re.sub (r'(?ms)<a ((?:rel="\w+")? ?(?:accesskey="[^"]+?")? ?(?:name=".*?")? ?)(href=".+?">)(<code>)?(Appendix )?([A-Z\d.]+ |)(.+?)(?(3)</code>)</a>:?', a_href_gettext, page)
-       page = re.sub (r'<h(\d)( class="\w+"|)>(Appendix |)([A-Z\d.]+ |)?([^<]+)</h\1>', h_gettext, page)
+       page = re.sub (r'<h(\d)( class="\w+"|)>\s*(Appendix |)([A-Z\d.]+ |)?([^<]*[^< ])\s*</h\1>', h_gettext, page)
        page = re.sub (r'<a href="(\.\./(?:music-glossary|lilypond-program/)?(?:.+?))">(.+?)</a>', crossmanual_ref_gettext, page)
        # this is necessary for entries not translated by a_href_gettext
        page = re.sub (r'<a href="(.+?)">(.+?)</a>', crossmanual_ref_gettext, page)