alxnbl / onenote-md-exporter

ConsoleApp to export OneNote notebooks to Markdown formats
GNU General Public License v3.0
886 stars 74 forks source link

Dot Not replace IMG tag by Md reference when image is nested into other HTML tags #48

Open alxnbl opened 2 years ago

alxnbl commented 2 years ago

Describe the bug

PanDoc post-processing replace IMG tag into Md References.

This post-processing should not replace IMG tab that are nested into other HTML tags like TABLE. Because MD references nested into HTML tags are not interpreted by Md readers.

alxnbl commented 3 weeks ago

In certain situations, Padoc converts Docx tables into Html because it does't manage to translate the content into markdown. But if the html table contains an image tag, the OneNoteExport translate it into markdown.

Html tags are supported inside mardown, but markdown is not supported inside html. rmarkdown. Which thus prevent the image to display.

An evolution of the code that replace html img tags is required to avoid replacement of img tags nested into an other html tag (or at least table tag). Maybe one generous contributor will take care of the evolution, or me but not in a near futur.

alxnbl commented 3 weeks ago

Location in the code : ExtractImagesToResourceFolder function in file https://github.com/alxnbl/onenote-md-exporter/blob/main/src/OneNoteMdExporter/Services/Export/ExportServiceBase.cs