espanso / hub-frontend

The official Espanso Hub website
https://hub.espanso.org
MIT License
11 stars 6 forks source link

Literal HTML in Markdown serialization fails #6

Open arabello opened 2 years ago

arabello commented 2 years ago

next-mdx-remote fails to serialize the Markdown package description when a literal HTML tag is not self-closed, e.g. <br>. After a small investigation it seems there is not ready-to-go plugin to fix it, even though the underlying mdx-js provide a way to correctly render it.

A naive fix was to replace the tag to the corresponding self-closing one, e.g. <br> to </br> at string level. This should be done only for specific tags that are crashing current packages, as it is not a robust solution.

Leaving this open to eventually find a proper fix

arabello commented 2 years ago

Generalizing this as other issue with HTML tags are emerging:

NB: String replacing is a temporary fix. This issue should be addressed using specific remark and rehype plugins or by writing a custom one.