From e08f60037830ebad2ca1fefc12c4819d6499012d Mon Sep 17 00:00:00 2001 From: Wayne Davison Date: Thu, 18 Jun 2020 22:52:47 -0700 Subject: [PATCH] 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. --- md2man | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/md2man b/md2man index f4f8ca4f..1b84162d 100755 --- a/md2man +++ b/md2man @@ -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('&', '&').replace('<', '<').replace('>', '>').replace('"', '"') - .replace('--', '‑‑').replace("\xa0-", ' ‑').replace("\xa0", ' ')) + .replace("\xa0", ' ').replace('--', '\4\4')).replace('\4', '-⁠') def warn(*msg): -- 2.47.2