]>
git.madduck.net Git - etc/mutt.git/blobdiff - .mutt/markdown2html
madduck's git repository
Every one of the projects in this repository is available at the canonical
URL git://git.madduck.net/madduck/pub/<projectpath> — see
each project's metadata for the exact URL.
All patches and comments are welcome. Please squash your changes to logical
commits before using git-format-patch and git-send-email to
patches@ git. madduck. net .
If you'd read over the Git project's submission guidelines and adhered to them,
I'd be especially grateful.
SSH access, as well as push access can be individually
arranged .
If you use my repositories frequently, consider adding the following
snippet to ~/.gitconfig and using the third clone URL listed for each
project:
[url "git://git.madduck.net/madduck/"]
insteadOf = madduck:
# convert hard line breaks within paragraphs to 2 trailing spaces, which
# is the markdown way of representing hard line breaks. Note how the
# regexp will not match between paragraphs.
# convert hard line breaks within paragraphs to 2 trailing spaces, which
# is the markdown way of representing hard line breaks. Note how the
# regexp will not match between paragraphs.
- ret = re.sub(r'(\S)\n(\s*\S)', r'\g<1> \n\g<2>', mdwn, re.MULTILINE)
+ ret = re.sub(r'(\S)\n(\s*\S)', r'\g<1> \n\g<2>', mdwn, flags= re.MULTILINE)
elif prev and re.match(r'^.+:\s*$', prev) and cur.startswith('>'):
ret.append(re.sub(r'^(\s*>\s*)+(.+)',
r'\g<1>{.quoteinitial}\g<2>',
elif prev and re.match(r'^.+:\s*$', prev) and cur.startswith('>'):
ret.append(re.sub(r'^(\s*>\s*)+(.+)',
r'\g<1>{.quoteinitial}\g<2>',
+ cur, flags= re.MULTILINE))
# All other occurrences of blockquotes get the "subsequent" marker:
# All other occurrences of blockquotes get the "subsequent" marker:
- elif cur.startswith('>') and not prev.startswith('>'):
+ elif cur.startswith('>') and prev and not prev.startswith('>'):
ret.append(re.sub(r'^((?:\s*>\s*)+)(.+)',
r'\g<1>{.quotesubsequent}\g<2>',
ret.append(re.sub(r'^((?:\s*>\s*)+)(.+)',
r'\g<1>{.quotesubsequent}\g<2>',
+ cur, flags= re.MULTILINE))
else: # pass through everything else.
ret.append(cur)
else: # pass through everything else.
ret.append(cur)
'''
ret = html.replace('<p>{.quotelead}', '<p class="quotelead">')
ret = re.sub(r'<blockquote>\n((?:<blockquote>\n)*)<p>(?:\{\.quote(\w+)\})',
'''
ret = html.replace('<p>{.quotelead}', '<p class="quotelead">')
ret = re.sub(r'<blockquote>\n((?:<blockquote>\n)*)<p>(?:\{\.quote(\w+)\})',
- r'<blockquote class="quote \g<2>">\n\g<1><p>', ret, re.MULTILINE)
+ r'<blockquote class="quote \g<2>">\n\g<1><p>', ret, flags= re.MULTILINE)