Closed itsdanjc closed 1 day ago
When following the latest stable version of the docs (Extend Marko). The resulting code is as follows:
from marko import inline from marko.helpers import MarkoExtension class GitHubWiki(inline.InlineElement): pattern = r'\[\[ *(.+?) *\| *(.+?) *\]\]' parse_children = True priority = 6 def __init__(self, match): self.target = match.group(2) class WikiRendererMixin(object): def render_github_wiki(self, element): return '<a href="{}">{}</a>'.format( self.escape_url(element.target), self.render_children(element) ) GitHubWiki = MarkoExtension( elements=[GitHubWiki], renderer_mixins=[WikiRendererMixin] ) marko = Markdown(extensions=[GitHubWiki]) marko.convert('# Example from marko documentation\n *This is an [[emphasis*|target]]')
Gives this result:
<h1>Example from marko documentation</h1> <p>*This is an emphasis*</p>
The docs suggests that this is the outcome:
<h1>Example from marko documentation</h1> <p>*This is an <a href="target">emphasis*</a></p>
Is this the correct behavior, or could you clarify if it's a mistake on my end?
Environment:
Thanks, this has been fixed on main
When following the latest stable version of the docs (Extend Marko). The resulting code is as follows:
Gives this result:
The docs suggests that this is the outcome:
Is this the correct behavior, or could you clarify if it's a mistake on my end?
Environment: