@@ -85,7 +85,8 @@ class ExternalLink(Node): | |||||
@url.setter | @url.setter | ||||
def url(self, value): | def url(self, value): | ||||
self._url = parse_anything(value) | |||||
from ..parser import contexts | |||||
self._url = parse_anything(value, contexts.EXT_LINK_URI) | |||||
@title.setter | @title.setter | ||||
def title(self, value): | def title(self, value): | ||||
@@ -24,8 +24,8 @@ from __future__ import unicode_literals | |||||
import re | import re | ||||
from .compat import maxsize, py3k, str | from .compat import maxsize, py3k, str | ||||
from .nodes import (Argument, Comment, Heading, HTMLEntity, Node, Tag, | |||||
Template, Text, Wikilink) | |||||
from .nodes import (Argument, Comment, ExternalLink, Heading, HTMLEntity, | |||||
Node, Tag, Template, Text, Wikilink) | |||||
from .string_mixin import StringMixIn | from .string_mixin import StringMixIn | ||||
from .utils import parse_anything | from .utils import parse_anything | ||||
@@ -509,6 +509,6 @@ class Wikicode(StringMixIn): | |||||
return "\n".join(self._get_tree(self, [], marker, 0)) | return "\n".join(self._get_tree(self, [], marker, 0)) | ||||
Wikicode._build_filter_methods( | Wikicode._build_filter_methods( | ||||
arguments=Argument, comments=Comment, headings=Heading, | |||||
html_entities=HTMLEntity, tags=Tag, templates=Template, text=Text, | |||||
wikilinks=Wikilink) | |||||
arguments=Argument, comments=Comment, external_links=ExternalLink, | |||||
headings=Heading, html_entities=HTMLEntity, tags=Tag, templates=Template, | |||||
text=Text, wikilinks=Wikilink) |
@@ -276,6 +276,7 @@ class TestWikicode(TreeEqualityTestCase): | |||||
self.assertEqual(["{{{e}}}"], get_filter("arguments")) | self.assertEqual(["{{{e}}}"], get_filter("arguments")) | ||||
self.assertIs(code.get(4), get_filter("arguments")[0]) | self.assertIs(code.get(4), get_filter("arguments")[0]) | ||||
self.assertEqual([], get_filter("comments")) | self.assertEqual([], get_filter("comments")) | ||||
self.assertEqual([], get_filter("external_links")) | |||||
self.assertEqual([], get_filter("headings")) | self.assertEqual([], get_filter("headings")) | ||||
self.assertEqual([], get_filter("html_entities")) | self.assertEqual([], get_filter("html_entities")) | ||||
self.assertEqual([], get_filter("tags")) | self.assertEqual([], get_filter("tags")) | ||||