~netlandish/django-wiki

c3fdde61432e48789fb700c05e67937c646d0cd6 — Peter Sanchez 11 months ago 4388762 org-support
More updates
2 files changed, 7 insertions(+), 2 deletions(-)

M src/wiki/plugins/links/mdx/djangowikilinks.py
M src/wiki/plugins/links/mdx/urlize.py
M src/wiki/plugins/links/mdx/djangowikilinks.py => src/wiki/plugins/links/mdx/djangowikilinks.py +3 -1
@@ 46,7 46,9 @@ class WikiPathExtension(markdown.extensions.Extension):
        WIKI_RE = r"\[(?P<label>[^\]]+?)\]\(wiki:(?P<wikipath>[a-zA-Z0-9\./_-]*?)(?P<fragment>#[a-zA-Z0-9\./_-]*)?\)"
        wikiPathPattern = WikiPath(WIKI_RE, self.config, md=md)
        wikiPathPattern.md = md
        md.inlinePatterns.add("djangowikipath", wikiPathPattern, "<reference")
        md.inlinePatterns.register(
            wikiPathPattern, "djangowikipath", 171
        )


class WikiPath(markdown.inlinepatterns.Pattern):

M src/wiki/plugins/links/mdx/urlize.py => src/wiki/plugins/links/mdx/urlize.py +4 -1
@@ 164,7 164,10 @@ class UrlizeExtension(markdown.extensions.Extension):

    def extendMarkdown(self, md):
        """ Replace autolink with UrlizePattern """
        md.inlinePatterns["autolink"] = UrlizePattern(URLIZE_RE, md)
        # md.inlinePatterns["autolink"] = UrlizePattern(URLIZE_RE, md)
        md.inlinePatterns.register(
            UrlizePattern(URLIZE_RE, md), "autolink", 91
        )


def makeExtension(*args, **kwargs):