listmonk icon indicating copy to clipboard operation
listmonk copied to clipboard

Specifying HTML/CSS attributes in markdown

Open olib14 opened this issue 1 year ago • 1 comments

Pandoc can be used to generate HTML content from a template HTML file, CSS styling and markdown content.

With it, you can specify attributes (id, class, width, height) for things, such as:

Links and images:

![](foo.jpg){#id .class width=30 height=20px} 

See: https://garrettgman.github.io/rmarkdown/authoring_pandoc_markdown.html#images (Extension: link_attributes)

Headers:

# My header {#identifier .class}

See: https://garrettgman.github.io/rmarkdown/authoring_pandoc_markdown.html#headers (Extension: header_attributes)

In practice, this allows you to provide a class to make an image float, and set its width to a nice value. Currently this functionality is still possible with raw HTML:

<img src="foo.jpg" class="float-right" style="width: 8em"/>
![](foo.jpg){.float-right width=8em}

<h3 class="fancy-heading">What's New<h3>
### What's New {.fancy-heading}

It would be a big QoL improvement (but understandably not be high priority as raw HTML allows for this and more).

olib14 avatar Sep 29 '24 23:09 olib14

If @yuin/goldmark, which listmonk uses for parsing Markdown, has support for this, there is no problem in enabling it. From a cursory look, I am not sure if it supports though.

knadh avatar Sep 30 '24 05:09 knadh

This issue has been marked 'stale' after 90 days of inactivity. If there is no further activity, it will be closed in 7 days.

github-actions[bot] avatar Dec 30 '24 02:12 github-actions[bot]