"**": ["b", False],
"##": ["tt", False],
"__": ["u", False],
+ "--": ["del", False],
"^^": ["sup", False],
",,": ["sub", False],
"''": ["em", False], # LEGACY
style[1] = not style[1]
return ['</', '<'][style[1]] + style[0] + '>'
+ def _glyph_repl(self, word):
+ return '—'
+
def _tit_repl(self, word):
if self.h_level:
result = '</h%d><p>\n' % self.h_level
print('<div class="wiki"><p>')
scan_re = re.compile(r"""(?:
- # Styles and formatting
- (?P<b> \*\*|'''|//|''|\#\#|``|__|\^\^|,,)
+ # Styles and formatting ("--" must cling to a word to disambiguate it from the dash)
+ (?P<b> \*\* | // | \#\# | __ | --\b | \b-- | \^\^ | ,, | ''' | '' | `` )
+ | (?P<glyph> --)
| (?P<tit> \={2,6})
| (?P<br> \\\\)
| (?P<rule> ^-{3,})
| (?P<hurl> \[\[([^\s\|]+)(?:\s*\|\s*([^\]]+)|)\]\])
# Inline HTML
- | (?P<html> <(br|hr|div|span|form|iframe|input|textarea|a|img|h[1-5])\b )
+ | (?P<html> <(br|hr|div|span|form|iframe|input|textarea|a|img|h[1-5])\b )
| (?P<htmle> ( /\s*> | </(br|hr|div|span|form|iframe|input|textarea|a|img|h[1-5])> ) )
| (?P<ent> [<>&] )