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

Added placeholder and edit note for not-found images

parent 59f07be5
No related branches found
No related tags found
No related merge requests found
......@@ -608,7 +608,7 @@ def processDocuments(documents:list[str],
fn = f'{imageDirName}{os.sep}{os.path.basename(zipMediaFilename)}'
if fn.lower().endswith(('.emf', '.wmf')):
_print(f'[yellow]unsupported media file: {fn}', highlight = False)
_print(f'[yellow]unsupported media file (will be converted): {fn}', highlight = False)
emfFiles.append(fn)
with open(f'{fn}', 'wb') as imgFile:
imgFile.write(zip.read(zipMediaFilename))
......@@ -705,7 +705,7 @@ def processDocuments(documents:list[str],
# Image Caption
elif style in docConfig.imagecaption:
checkSameStyle(Style.imagecaption, lambda:lines.append(''))
_t = replaceNL(text).strip()
_t = replaceNL(text).strip().replace('<br />', ' ')
lines.append(f'**{_t}**')
lines.append('')
if docConfig.imageCaptions2AltText:
......@@ -717,7 +717,13 @@ def processDocuments(documents:list[str],
# Image & Figure
elif style in docConfig.image:
lines.append('')
lines.append(text)
if text:
# If we have an image name
lines.append(text)
else:
# If we have no image name we add a placeholder
lines.append('<mark>Please add the correct image caption and filename</mark>')
lines.append(f'![{_captionMarker}]({imagesSubDir}/???.png)')
# Code
elif style in docConfig.code:
......
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