EnlighterJS
EnlighterJS copied to clipboard
Links embedded in code
Is there a way to have a part of code have a link so that when clicked, a user may be redirected to documentation, for example? If not, is there some other JS library that would provide this?
Thank you.
not at the moment - in the past there were a few feature requests but it's difficult to implement:
- a unique markup is required to "mark" the links within the code without affecting language rules (
<a>tags won't work) - the links/references have to be stored in some kind of metadata "container" outside the coceblock or within the markup
- all editor plugins must be able to add these kind of references+metadata
- the tokenizer needs to be modified to allow "immutable tokens" to process the links
- adding a link to specific element would removed the highlighting (easy solution) or just adding a
<a>tag to the rendered content (complicated).
proposals are welcome
I see, thanks for clarifying. Are you aware of any other approaches for code highlighting with a link embedded?
not really