Use -⁠ instead of ‑

Using a non-breaking zero-width char after a dash makes the browser
avoiding breaking on that dash and also makes it match a dash in a
search.  This is better than a non-breaking dash char, which does not
match a dash in a search.
This commit is contained in:
Wayne Davison
2020-06-18 22:52:47 -07:00
parent e406845542
commit e08f600378

4
md2man
View File

@@ -339,9 +339,9 @@ def manify(txt):
def htmlify(txt):
return re.sub(r'(\W)-', r'\1‑',
return re.sub(r'(^|\W)-', r'\1-⁠',
txt.replace('&', '&amp;').replace('<', '&lt;').replace('>', '&gt;').replace('"', '&quot;')
.replace('--', '&#8209;&#8209;').replace("\xa0-", '&nbsp;&#8209;').replace("\xa0", '&nbsp;'))
.replace("\xa0", '&nbsp;').replace('--', '\4\4')).replace('\4', '-&#8288;')
def warn(*msg):