Skip to content
Snippets Groups Projects
Commit c670c4c2 authored by Andreas Kraft's avatar Andreas Kraft
Browse files

Improved error reporting in output. Added "annotationRef" as ignored document...

Improved error reporting in output. Added "annotationRef" as ignored document element. Improved character replacement
parent dfab5367
No related branches found
No related tags found
No related merge requests found
...@@ -350,6 +350,7 @@ def processDocuments(documents:list[str], ...@@ -350,6 +350,7 @@ def processDocuments(documents:list[str],
'commentReference', 'commentReference',
'smartTag', 'smartTag',
'footnoteRef', 'footnoteRef',
'annotationRef',
) )
...@@ -822,7 +823,7 @@ def processDocuments(documents:list[str], ...@@ -822,7 +823,7 @@ def processDocuments(documents:list[str],
lines.append('') # Add an empty line before a table lines.append('') # Add an empty line before a table
if errorDetected: 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.append('') # Add an empty line before a table
lines.extend(tableLines) lines.extend(tableLines)
lines.append('') # Add another empty line after a table lines.append('') # Add another empty line after a table
...@@ -846,6 +847,9 @@ def processDocuments(documents:list[str], ...@@ -846,6 +847,9 @@ def processDocuments(documents:list[str],
lines[i] = line lines[i] = line
else: 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))}') _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
# #
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment