crowdagger / crowbook

Converts books written in Markdown to HTML, LaTeX/PDF and EPUB

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

`img` tag with local src url hasn't been imported?

hustcer opened this issue · comments

<img src="./img/ferris/does_not_compile.svg" class="ferris-explain" alt="Ferris with a question mark">

There is a SVG file from the relative path of current markdown file at ./img/ferris/does_not_compile.svg, and
It seemed like that the code snippet above was rendered as raw text instead of a html img Tag.

Maybe a subset of HTML tags could be supported like <span>, <br>, <p>, <img>, <pre>, <em>, <strong> etc.

Other REF: https://www.markdownguide.org/basic-syntax/#html

According to the README this is probably intentional:

Inline HTML, however, is not implemented, and probably won't be, as the goal is to have books that can also be generated in PDF (and maybe ODT).

For HTML and EPUB creation the markdown for images should work just fine:

![Ferris with a question mark](./img/ferris/does_not_compile.svg)

The creation of PDF would currently fail because crowbook's PDF rendering does not handle SVG images yet. This would probably require either the usage of a LaTeX package like svg or converting the SVG as PNG with a crate like resvg. It might also be fine to just tell people to use PNG instead of SVG for better interoperability?

@lise-henry Thank you very much. I found it very handy and like it very much. Great work!