diff --git a/spec2md.py b/spec2md.py index 15f99c568ab8458fc88fa2d59cb7f7cba75853a3..ecf6ead2551ef3b4785b418a43fbf3436ce365b5 100644 --- a/spec2md.py +++ b/spec2md.py @@ -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'') # Code elif style in docConfig.code: