markdown-it-sup icon indicating copy to clipboard operation
markdown-it-sup copied to clipboard

How to render reference-style links inside `<sup>`?

Open undergroundwires opened this issue 1 year ago • 1 comments

Hi,

First of all thank you for this super easy-to-use plugin. It has been a joy to use it without any issues and it empowers privacy.sexy.

I'm using a lot of reference-style links and I'd like to render them inside <sup> blocks just like wikipedia does to not disturb to reading experience.

I did some research, see that this can be achieved through markdown-it-sup but this require caret syntax which I want to avoid.

Is there away to achieve this? Did anyone have the same issue? How did you resolve this?

Note: This is how I extend markdown rendering as of today.

undergroundwires avatar Jan 29 '24 17:01 undergroundwires

For anyone looking for solution, I achieved this by:

  1. Enabling HTML content in markdown (through html: true option).
  2. I've done implemented a preprocessor that wraps bracket references inside <sup></sup>, see InlineReferenceLabelsToSuperscriptConverter.ts.

undergroundwires avatar Feb 09 '24 14:02 undergroundwires