Skip to content

Commit

Permalink
Fix markdown rendering with the MyST parser (#5494) (#5497)
Browse files Browse the repository at this point in the history
- MyST parser does not work with Panel 1.2.2 (#5494) and the commit fixes it.
  • Loading branch information
monodera authored Sep 11, 2023
1 parent 36a1d92 commit b1d1f9d
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions panel/pane/markup.py
Original file line number Diff line number Diff line change
Expand Up @@ -367,8 +367,6 @@ def applies(cls, obj: Any) -> float | bool | None:
def _get_parser(cls, renderer, plugins, **renderer_options):
if renderer == 'markdown':
return None
if "breaks" not in renderer_options:
renderer_options["breaks"] = True
from markdown_it import MarkdownIt
from markdown_it.renderer import RendererHTML
from mdit_py_plugins.anchors import anchors_plugin
Expand All @@ -384,6 +382,9 @@ def hilite(token, langname, attrs):
return token

if renderer == 'markdown-it':
if "breaks" not in renderer_options:
renderer_options["breaks"] = True

parser = MarkdownIt(
'gfm-like',
renderer_cls=RendererHTML,
Expand Down

0 comments on commit b1d1f9d

Please sign in to comment.