markdown-rs icon indicating copy to clipboard operation
markdown-rs copied to clipboard

Automatically add IDs to headings

Open IndigoCurnick opened this issue 2 years ago • 6 comments

Hi!

In older versions of the crate, HTML headings would automatically be assigned an id based on the markdown heading

For example,

# Hello World

would become

<h1 id="hello_world">Hello World</h1>

Is there an option for this? If not, would it be possible to support it?

Thanks :)

IndigoCurnick avatar Aug 01 '23 14:08 IndigoCurnick

Hey!

No, no option.

I’d prefer to land plugins first (see other issues). Then those could solve this nicely!

wooorm avatar Aug 01 '23 14:08 wooorm

I was just checking out issue #32 which does seem to be what we want here, I think?

IndigoCurnick avatar Aug 01 '23 15:08 IndigoCurnick

yep, things like that!

wooorm avatar Aug 01 '23 16:08 wooorm

I was just checking out issue #32 which does seem to be what we want here, I think?我刚刚查看了问题 #32,我认为这似乎是我们想要的?

hey,How did you accomplish it,I met the same problem

Liboq avatar Nov 02 '23 08:11 Liboq

Not quite yet, looks like #32 is still in development and this will need to wait till then unfortunately. I did write something which inserts them after the fact, but it's a little complicated and not really that good

IndigoCurnick avatar Nov 02 '23 10:11 IndigoCurnick

Either the customized "class" not work?

tsurumi-yizhou avatar Dec 04 '23 02:12 tsurumi-yizhou