diff --git a/pelican/contents.py b/pelican/contents.py index 94790612..b453f61b 100644 --- a/pelican/contents.py +++ b/pelican/contents.py @@ -182,13 +182,15 @@ class Content(object): if not content: return content - hrefs = re.compile(r""" + instrasite_link_regex = self.settings['INTRASITE_LINK_REGEX'] + regex = r""" (?P<\s*[^\>]* # match tag with src and href attr (?:href|src)\s*=) (?P["\']) # require value to be quoted - (?P[|{](?P.*?)[|}](?P.*?)) # the url value - \2""", re.X) + (?P{0}(?P.*?)) # the url value + \2""".format(instrasite_link_regex) + hrefs = re.compile(regex, re.X) def replacer(m): what = m.group('what') diff --git a/pelican/settings.py b/pelican/settings.py index 1f2646f6..1c2db677 100644 --- a/pelican/settings.py +++ b/pelican/settings.py @@ -110,6 +110,7 @@ DEFAULT_CONFIG = { 'TEMPLATE_PAGES': {}, 'IGNORE_FILES': ['.#*'], 'SLUG_SUBSTITUTIONS': (), + 'INTRASITE_LINK_REGEX': '[{|](?P.*?)[|}]', }