Skip to content

Commit

Permalink
Fixed Yosemite increasing quote level for attribution
Browse files Browse the repository at this point in the history
  • Loading branch information
robertklep committed Oct 20, 2014
1 parent f9fea1f commit efb8fa0
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions quotefix/attribution.py
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,12 @@ def customize_attribution(cls, original, editor, dom, reply, inreplyto, template
root = dom.documentElement()
html = root.innerHTML()

# Fix Yosemite attributions
import platform
osversion = platform.mac_ver()[0]
if osversion == '10.10':
html = re.sub(r'(?i)(<blockquote.*?>)(<div>.*?</div>)(<br.*?>)?', r'\2\3\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.
if is_sendagain or matcher == None:
Expand Down

0 comments on commit efb8fa0

Please sign in to comment.