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

Fixed problem with symbol (non-unicode) character replacements

parent f46a2a97
No related branches found
No related tags found
No related merge requests found
......@@ -100,6 +100,13 @@ ff0c = 2c20
d7 = 78
; Ligature "fi"
fb01 = 6669
; "<="
f0fd = 3c3d
; "=>"
f0e0 = 3e3d
; "<=>"
f0df = 3c3d3e
[media]
......
......@@ -402,9 +402,22 @@ def processDocuments(documents:list[str], outDirectory:str, skipImageConversion:
pass # ignore a soft hyphen character which has no meaning in Markdown and zero-width
case 'sym':
_symError = f'unknown font+symbol: {element.attrib["{"+wns+"}font"]} - "{element.attrib["{"+wns+"}char"]}"'
_print(f'[yellow]{_symError}')
_result += f'<mark>{_symError}</mark>'
def _symError(ch:str) -> str:
nonlocal _result
_symError = f'unknown font+symbol: {element.attrib["{"+wns+"}font"]} - "{element.attrib["{"+wns+"}char"]} ({ch})"'
_print(f'[yellow]{_symError}')
_result += f'<mark>{_symError}</mark>'
try:
_ch = '????'
_ch = int(element.attrib["{"+wns+"}char"], 16)
if _ch in docConfig.characters:
if (rch := docConfig.characters[_ch]) == chr(0):
rch = ''
_result += rch
else:
_symError(_ch)
except ValueError as e:
_symError(_ch)
# ignore deleted test
case 'del':
......@@ -791,7 +804,7 @@ def processDocuments(documents:list[str], outDirectory:str, skipImageConversion:
for i in range(len(lines)):
line = lines[i]
if _captionMarker in line:
_print(f'[yellow]Unresolved figure caption : \[{i}] "{line}"')
_print(f'[yellow]Unresolved / unreferenced figure caption : \[{i}] "{line}"')
#
# Write produced Markdown file
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment