Use `-⁠` instead of `‑`
authorWayne Davison <wayne@opencoder.net>
Fri, 19 Jun 2020 05:52:47 +0000 (22:52 -0700)
committerWayne Davison <wayne@opencoder.net>
Fri, 19 Jun 2020 05:58:11 +0000 (22:58 -0700)
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.

md2man

diff --git a/md2man b/md2man
index f4f8ca4fa7dfcfcbd4f354f5306afe3232cc40e2..1b84162de4b7d1d2bf8f3ca55fbb607cce2662cb 100755 (executable)
--- a/md2man
+++ b/md2man
@@ -339,9 +339,9 @@ def manify(txt):
 
 
 def htmlify(txt):
-    return re.sub(r'(\W)-', r'\1&#8209;',
+    return re.sub(r'(^|\W)-', r'\1-&#8288;',
             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):