arobase-che / remark-attr

Remark plugin to add support for custom attributes
Other
58 stars 16 forks source link

Support for linkReference #15

Closed ngsctt closed 4 years ago

ngsctt commented 4 years ago

Could you add support for the linkReference node? I tried forking and extending the plugin myself, but I ultimately couldn't make it work.

The problem

The following markdown:

[first link](http://example.com/1){hreflang="en"}   <!-- works -->
[second link][reference]{hreflang="en"}             <!-- doesn't work -->
[third link][]{hreflang="en"}                       <!-- doesn't work -->

[reference]:  http://example.com/2
[third link]: http://example.com/3

produces the following HTML output:

<a href="http://example.com/1" hreflang="en">first link</a>
<a href="http://example.com/2">second link</a>{hreflang="en"}
<a href="http://example.com/3">third link</a>{hreflang="en"}

instead of:

<a href="http://example.com/1" hreflang="en">first link</a>
<a href="http://example.com/2" hreflang="en">second link</a>
<a href="http://example.com/3" hreflang="en">third link</a>
arobase-che commented 4 years ago

Ok. So I studied a little that case.

link reference are tokenized by the block Tokenizer definition. I can quickly make a PoC but i got to study a little more this tokenizer before extend it.

arobase-che commented 4 years ago

I didn't find any trouble. In fact, it help's me support footnotes.

Now in master. Soon released.

xsq007 commented 4 years ago

I didn't find any trouble. In fact, it help's me support footnotes.

Now in master. Soon released.

Could you please release the latest master? Need reference-link feature. Thanks.

arobase-che commented 4 years ago

Done ! ^^