Commit c670c4c2 authored by ankraft's avatar ankraft
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
Loading
Loading
Loading
Loading
+5 −1
Original line number Original line Diff line number Diff line
@@ -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],
						
						
						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],
							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

		
		


			#
			#