From: John Mandereau Date: Sun, 27 Apr 2008 12:02:37 +0000 (+0200) Subject: Improve French typography in HTML docs X-Git-Tag: release/2.11.46-1~40 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=7eee422ca74f75200e2ea66f1510d757f9b7b94c;p=lilypond.git Improve French typography in HTML docs --- diff --git a/Documentation/fr/user/macros.itexi b/Documentation/fr/user/macros.itexi index 024eaae1cf..9fdefe5876 100644 --- a/Documentation/fr/user/macros.itexi +++ b/Documentation/fr/user/macros.itexi @@ -45,10 +45,9 @@ @end html @end macro -@c FIXME: hack unbreakable thin spaces @macro qq{TEXT} @html -« \TEXT\ » +« \TEXT\ » @end html @end macro @end ifhtml @@ -61,10 +60,9 @@ @end xml @end macro -@c FIXME: hack unbreakable thin spaces @macro qq{TEXT} @xml -« \TEXT\ » +« \TEXT\ » @end xml @end macro @end ifdocbook diff --git a/python/langdefs.py b/python/langdefs.py index 80a1c7f244..d3b6a0872d 100644 --- a/python/langdefs.py +++ b/python/langdefs.py @@ -36,17 +36,28 @@ class LanguageDef: site = LanguageDef ('en', 'English', webext='') -html_page_body = re.compile ('', re.M | re.I) +html_body_re = re.compile ('', re.I) +html_end_body_re = re.compile ('', re.I) french_html_typo_rules = ((' :', ' :'), (' ;', ' ;'), - (' ?', ' ?'), - (' !', ' !')) + (' ?', ' ?'), + (' !', ' !')) def french_html_filter (page): - parts = html_page_body.split (page) + m = html_page_body_re.search (page) + if m: + body_begin = m.end () + else: + body_begin = 0 + m = html_end_body_re.search (page) + if m: + body_end = m.start () + else: + body_end = len (page) + body = page[body_begin:body_end] for r in french_html_typo_rules: - parts[1] = parts[1].replace (r[0], r[1]) - return parts[0] + '' + parts[1] + '' + parts[2] + body = body.replace (r[0], r[1]) + return page[:body_begin] + body + page[body_end:] fr = LanguageDef ('fr', 'français', double_punct_char_sep=' ', html_filter = french_html_filter) es = LanguageDef ('es', 'español')