Skip to content

Conversation

@mrh-jishan
Copy link

This refactor introduces a utility function getMarked that allows you to conditionally enable or disable syntax highlighting for Markdown code blocks using highlight.js and marked. The function accepts a useHighlightJs boolean flag:

If useHighlightJs is true, code blocks in Markdown will be highlighted using highlight.js.
If useHighlightJs is false, code blocks will be rendered as plain text without syntax highlighting.
This makes it easy to toggle code highlighting based on user preference or API input, and keeps your Markdown rendering logic clean and flexible.

@simonhaenisch
Copy link
Owner

Sry completely missed this PR till now. Just wondering how would someone provide the value for useHighlightJs to the function though?

Also changing it to false by default is a breaking change

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants