[SCM] The rsync repository. - branch master updated
Rsync CVS commit messages
rsync-cvs at lists.samba.org
Mon Jun 15 01:30:32 UTC 2020
The branch, master has been updated
via 660274bf A few more md -> html improvements
from 59cf9ff7 More NEWS improvements.
https://git.samba.org/?p=rsync.git;a=shortlog;h=master
- Log -----------------------------------------------------------------
commit 660274bfb7e7da5fa94e4594aba74d4d98fb8d9e
Author: Wayne Davison <wayne at opencoder.net>
Date: Sun Jun 14 18:28:30 2020 -0700
A few more md -> html improvements
-----------------------------------------------------------------------
Summary of changes:
md2man | 4 +++-
packaging/md2html | 6 +++++-
2 files changed, 8 insertions(+), 2 deletions(-)
Changeset truncated at 500 lines:
diff --git a/md2man b/md2man
index 8736dd1c..7ee63f53 100755
--- a/md2man
+++ b/md2man
@@ -334,7 +334,9 @@ def manify(txt):
def htmlify(txt):
- return txt.replace('&', '&').replace('<', '<').replace('>', '>').replace('"', '"').replace("\xa0", ' ')
+ return re.sub(r'(\W)-', r'\1‑',
+ txt.replace('&', '&').replace('<', '<').replace('>', '>').replace('"', '"')
+ .replace('--', '‑‑').replace("\xa0-", ' ‑').replace("\xa0", ' '))
def warn(*msg):
diff --git a/packaging/md2html b/packaging/md2html
index 6c944458..a1613aa7 100755
--- a/packaging/md2html
+++ b/packaging/md2html
@@ -44,6 +44,9 @@ md_parser = None
def main():
for mdfn in args.mdfiles:
+ if not mdfn.endswith('.md'):
+ print('Ignoring non-md input file:', mdfn)
+ continue
title = re.sub(r'.*/', '', mdfn).replace('.md', '')
htfn = mdfn.replace('.md', '.html')
@@ -57,7 +60,8 @@ def main():
html = md_parser(txt)
html = re.sub(r'(<code>)([\s\S]*?)(</code>)', lambda m: m[1] + re.sub(r'\s', '\xa0', m[2]) + m[3], html)
- html = html.replace("\xa0", ' ')
+ html = html.replace('--', '‑‑').replace("\xa0-", ' ‑').replace("\xa0", ' ')
+ html = re.sub(r'(\W)-', r'\1‑', html)
with open(htfn, 'w', encoding='utf-8') as fh:
fh.write(HTML_START % title)
--
The rsync repository.
More information about the rsync-cvs
mailing list