Skip to content

Commit

Permalink
Cleanup of blockquote unquote fix for Yosemite
Browse files Browse the repository at this point in the history
  • Loading branch information
robertklep committed Oct 20, 2014
1 parent ffc2bd1 commit c5bc096
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions quotefix/attribution.py
Expand Up @@ -5,7 +5,7 @@
from quotefix.pyratemp import Template
from quotefix.messagetypes import *
from quotefix.attributionclasses import *
import re
import re, platform

# Mavericks
try:
Expand Down Expand Up @@ -173,13 +173,10 @@ def customize_attribution(cls, original, editor, dom, reply, inreplyto, template
html = root.innerHTML()

# Fix Yosemite attributions
import platform
osversion = platform.mac_ver()[0]
if osversion.startswith('10.10'):
# move <blockquote> one level down
html = re.sub(r'(?i)(<blockquote.*?>)(.*?)(<br.*?>)', r'\2\1', html, count = 1)
# remove trailing whitespace after <blockquote>
html = re.sub(r'(?i)(<blockquote.*?>)(<br.*?>)+', r'\1', html, count = 1)
html = re.sub(r'(?i)(<blockquote.*?>)(.*?)(<br.*?>)+', r'\2\1', html, count = 1)

# Special case: Mail doesn't include an attribution for Send Again messages,
# so we'll just add a customized attribution right after the <body> element.
Expand Down

0 comments on commit c5bc096

Please sign in to comment.