Skip to content

v2.1.0 — HTML images, formatted document titles, and bug fixes

Latest

Choose a tag to compare

@leonardosalasd leonardosalasd released this 10 Sep 02:11
39f2196

What's new

Raw HTML <img> tags are rendered. A file that embeds its pictures with <img src="..."> instead of ![alt](...) now gets them in the PDF, through the same path Markdown images already take: local files embedded and deduplicated, remote ones behind --fetch-images, and a missing file falling back to its alt text.

Those images honor width and height. A CSS pixel is a 96th of an inch, so width="300" becomes a real measurement instead of a guess about how wide a page is. No picture is drawn wider than the text block however large the number is, and percentages are ignored, since fitting the text block is what the default already does.

Formatted document titles. A first heading written as # **Bold** and *italic* now reaches the cover page as bold and italic, rather than showing its asterisks. The title runs through the same inline pipeline as body headings, so strikethrough, math, inline code, citations and reference links behave there exactly as they do anywhere else. PDF metadata keeps a plain-text title, running headers stay unformatted, and an explicit --title or a front-matter title is still taken literally.

Fixes

  • The heading promoted to the cover is now the one removed from the body. A # line inside fenced code is left where it belongs, and a title written with an underline instead of a # is recognized.
  • mermaidx >= 0.9.5, which ends the InvalidVersion: Invalid version: '' crash that some 2.0.0 installs ran into. Fixed upstream in MohammadRaziei/mermaidx#34.
  • mistune >= 3.3. Earlier releases parse **bold and *italic*** as literal text, so the same document could come out two different ways depending on which version the resolver happened to pick.

Thanks

Most of this release is other people's work.

@mikevillari wrote the HTML image support, and @biggdawg320 the formatted titles. Both arrived as pull requests from outside, both came back a second time with the review addressed, and both are better than what I had planned to write myself.

@johnblommers does not appear in the diff, and two of the fixes above exist because of him. He has reported every install failure he has hit across three releases now, with the whole traceback each time, and then gone and tested the fix. From my side the crash named neither the dependency nor the cause; without his output it would still be open.

Install

pipx upgrade doc-engine-cli