Replies: 2 comments
-
This sounds like it should be a question on the marked-directive repo since that is an external extension not built by the marked team. It sounds like you need a new option or to fork it and create a new extension. |
Beta Was this translation helpful? Give feedback.
0 replies
-
Ah, yes — sorry about that. I wasn't quite sure what the relationship was between the library of known extensions and marked itself.
Best wishes,
Jason
—
Prof. J. McKenzie Alexander
Department of Philosophy, Logic and Scientific Method
London School of Economics and Political Science
Houghton Street, London WC2A 2AE
On 21 Feb 2025, at 15:40, Tony Brix ***@***.***> wrote:
This sounds like it should be a question on the marked-directive<https://github.com/bent10/marked-extensions/tree/main/packages/directive> repo since that is an external extension not built by the marked team.
It sounds like you need a new option or to fork it and create a new extension.
—
Reply to this email directly, view it on GitHub<#3623 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/ADFPKYACEHKXIU5TOJM6OCL2Q5CGVAVCNFSM6AAAAABXTESLJ2VHI2DSMVQWIX3LMV43URDJONRXK43TNFXW4Q3PNVWWK3TUHMYTEMRXHAYDCOI>.
You are receiving this because you authored the thread.Message ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
When using marked-directive, is it possible to add a tokenizer to a custom directive? I know that marked-directive supports a custom renderer function, but it would be useful to be able to over-ride the tokenizer to perform additional tasks on the raw source of a container.
For example, I've written a custom directive that contains markdown source, which shows a code-fenced markdown block to the left of the rendered markdown code. (This is nice because the markdown source only has to be entered once, ensuring the displayed code and rendered output are consistent.) However, since marked-directive only provides a custom renderer function, at present I am generating the code-fenced block and tokenizing it in the rendering function – which I've found can corrupt the global token list. Right now, I avoid this by having a second, independent instance of marked available in my node app on which I can call marked.parse(). This works, as far as the formatted output is concerned, but it means that the tokens for the fenced code block do not appear in the global token list.
Thanks in advance for any suggestions!
Beta Was this translation helpful? Give feedback.
All reactions