blyxyas / mdbook-emojicodes

MDBook preprocessor for converting emojicodes (e.g. `: cat :`) into emojis 🐱
https://crates.io/crates/mdbook-emojicodes
MIT License
11 stars 2 forks source link

Custom emojis just does not work in md headers #5

Closed savbran closed 1 year ago

savbran commented 1 year ago

Hello @blyxyas,

sorry to bother but I want to report an issue: when you put a custom emoji :example_emoji: in a markdown header it is not rendered. Unfortunately it just work in paragraphs.

Example:

This is a paragraph and :example_emoji: works.

This is a header and :example_emoji: does not work

Thanks in advance for the info you can provide.

blyxyas commented 1 year ago

The latest release available on crates.io (0.2.2) is an optimization on the codegen engine (using <object> instead of "copy-pasting" everytime an custom emoji is used) that also contains a half fix for this bug. The SVG format isn't really supported inside <h1> tags, so sadly, custom emojis seem displaced to the bottom (better than nothing).

Contributions to improve on this are welcomed!