From fe84fd3519802766b96a3e614279c378797d2aa0 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sat, 9 Jan 2016 07:56:06 +0530 Subject: [PATCH] Add - to allowed chars in HTML tag names For example from MathML --- src/calibre/gui2/tweak_book/editor/syntax/html.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/calibre/gui2/tweak_book/editor/syntax/html.py b/src/calibre/gui2/tweak_book/editor/syntax/html.py index 97900be8a6..d3e9d5e613 100644 --- a/src/calibre/gui2/tweak_book/editor/syntax/html.py +++ b/src/calibre/gui2/tweak_book/editor/syntax/html.py @@ -28,7 +28,7 @@ from html5lib.constants import cdataElements, rcdataElements cdata_tags = cdataElements | rcdataElements normal_pat = re.compile(r'[^<>&]+') entity_pat = re.compile(r'&#{0,1}[a-zA-Z0-9]{1,8};') -tag_name_pat = re.compile(r'/{0,1}[a-zA-Z0-9:]+') +tag_name_pat = re.compile(r'/{0,1}[a-zA-Z0-9:-]+') space_chars = ' \t\r\n\u000c' attribute_name_pat = re.compile(r'''[^%s"'/><=]+''' % space_chars) self_closing_pat = re.compile(r'/\s*>')