From c670c4c25e36cafaeb07bcc8da69dc3aecd4d750 Mon Sep 17 00:00:00 2001 From: ankraft <an.kraft@gmail.com> Date: Thu, 3 Apr 2025 11:05:22 +0200 Subject: [PATCH] Improved error reporting in output. Added "annotationRef" as ignored document element. Improved character replacement --- spec2md.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/spec2md.py b/spec2md.py index ecf6ead..a1bcac8 100644 --- a/spec2md.py +++ b/spec2md.py @@ -350,6 +350,7 @@ def processDocuments(documents:list[str], 'commentReference', 'smartTag', 'footnoteRef', + 'annotationRef', ) @@ -822,7 +823,7 @@ def processDocuments(documents:list[str], lines.append('') # Add an empty line before a table if errorDetected: - lines.append('<mark>The table below caused an error during conversion and may need extra attention</mark>') + lines.append('<mark>The table below caused an error during conversion (e.g. incorrect number of columns) and may need extra attention</mark>') lines.append('') # Add an empty line before a table lines.extend(tableLines) lines.append('') # Add another empty line after a table @@ -846,6 +847,9 @@ def processDocuments(documents:list[str], lines[i] = line else: _print(f'[yellow]({linenumber(i)}) Non-ASCII character (consider to add a replacement in the config.ini file): "{ch}" / {ord(ch)} / {hex(ord(ch))}') + line = line.replace(ch, f'<mark>Non-ASCII character {ch} / {hex(ord(ch))}</mark>') + lines[i] = line + # -- GitLab