1
0
Fork 0
forked from github/pelican

Merge pull request #1071 from talha131/change-intrasite-link-syntax-updated

Change intrasite link syntax updated
This commit is contained in:
Alexis Metaireau 2013-09-08 14:00:57 -07:00
commit dd66ad6731
5 changed files with 30 additions and 12 deletions

View file

@ -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<markup><\s*[^\>]* # match tag with src and href attr
(?:href|src)\s*=)
(?P<quote>["\']) # require value to be quoted
(?P<path>\|(?P<what>.*?)\|(?P<value>.*?)) # the url value
\2""", re.X)
(?P<path>{0}(?P<value>.*?)) # the url value
\2""".format(instrasite_link_regex)
hrefs = re.compile(regex, re.X)
def replacer(m):
what = m.group('what')

View file

@ -110,6 +110,7 @@ DEFAULT_CONFIG = {
'TEMPLATE_PAGES': {},
'IGNORE_FILES': ['.#*'],
'SLUG_SUBSTITUTIONS': (),
'INTRASITE_LINK_REGEX': '[{|](?P<what>.*?)[|}]',
}