diff --git a/pelican/contents.py b/pelican/contents.py index 94790612..1f326b0d 100644 --- a/pelican/contents.py +++ b/pelican/contents.py @@ -182,13 +182,7 @@ class Content(object): if not content: return content - hrefs = re.compile(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) + hrefs = re.compile(self.settings['INTRASITE_LINK_REGEX'], re.X) def replacer(m): what = m.group('what') diff --git a/pelican/settings.py b/pelican/settings.py index 1f2646f6..7b656960 100644 --- a/pelican/settings.py +++ b/pelican/settings.py @@ -110,6 +110,13 @@ DEFAULT_CONFIG = { 'TEMPLATE_PAGES': {}, 'IGNORE_FILES': ['.#*'], 'SLUG_SUBSTITUTIONS': (), + 'INTRASITE_LINK_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""", }