From caf0b9e4a04dab0942c5c1fb72430f12bac51411 Mon Sep 17 00:00:00 2001 From: Mads Jensen Date: Thu, 26 Sep 2019 20:49:22 +0200 Subject: [PATCH] Fixed some lint warnings. --- src/wiki/plugins/attachments/markdown_extensions.py | 2 +- src/wiki/plugins/links/mdx/urlize.py | 2 +- src/wiki/plugins/macros/mdx/wikilinks.py | 1 + tests/plugins/links/test_urlize.py | 7 +++---- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/wiki/plugins/attachments/markdown_extensions.py b/src/wiki/plugins/attachments/markdown_extensions.py index 5438a1a1..79ce8561 100644 --- a/src/wiki/plugins/attachments/markdown_extensions.py +++ b/src/wiki/plugins/attachments/markdown_extensions.py @@ -88,7 +88,7 @@ class AttachmentPreprocessor(markdown.preprocessors.Preprocessor): ).format(attachment_id) line = line.replace( '[' + m.group(2) + ']', - self.markdown.htmlStash.store(html) + self.markdown.htmlStash.store(html) ) new_text.append(before + line + after) return new_text diff --git a/src/wiki/plugins/links/mdx/urlize.py b/src/wiki/plugins/links/mdx/urlize.py index 8825f439..672a15bd 100644 --- a/src/wiki/plugins/links/mdx/urlize.py +++ b/src/wiki/plugins/links/mdx/urlize.py @@ -155,7 +155,7 @@ class UrlizePattern(markdown.inlinepatterns.Pattern): el = markdown.util.etree.Element("a") el.set('href', url) el.set('target', '_blank') - el.set('rel', 'nofollow') + el.set('rel', 'nofollow') el.append(icon) el.append(span_text) diff --git a/src/wiki/plugins/macros/mdx/wikilinks.py b/src/wiki/plugins/macros/mdx/wikilinks.py index 8dd9c9b5..08acbc5d 100644 --- a/src/wiki/plugins/macros/mdx/wikilinks.py +++ b/src/wiki/plugins/macros/mdx/wikilinks.py @@ -57,6 +57,7 @@ class WikiLinks(wikilinks.WikiLinksInlineProcessor): a.set('class', html_class) return a, m.start(0), m.end(0) + def makeExtension(*args, **kwargs): """Return an instance of the extension.""" return WikiLinkExtension(*args, **kwargs) diff --git a/tests/plugins/links/test_urlize.py b/tests/plugins/links/test_urlize.py index 3ca9b268..cf23eead 100644 --- a/tests/plugins/links/test_urlize.py +++ b/tests/plugins/links/test_urlize.py @@ -1,5 +1,4 @@ import html -from unittest import mock import markdown import pytest @@ -151,15 +150,15 @@ FIXTURE_NEGATIVE_MATCHES = [ '

localhosts

' ), ( - 'localhost', + 'localhost', '

localhost

' ), ( - 'localhost:8000', + 'localhost:8000', '

localhost:8000

' ), - + # Incomplete FQDNs. ( 'example.', -- 2.45.2