#7896 Better plaintext mail for commit notifications

v1.8.0
closed
None
General
nobody
2018-02-05
2015-06-12
No

Our plaintext mail messages just send markdown without converting it to HTML. So all plain text views will see some markdown formatting. Commit notifications also include HTML tags in each commit message. This is from the summary = g.markdown_commit.convert(ci.message) in def send_notifications rendering commit-markdown -> HTML. (Before [#7825] the commit message text was just passed through without this step but that caused inadvertent markdown formatting for things like __init__, or if (*pArray[j+1] > *pArray[j])

Example of the HTML coming through in plain text: https://forge-allura.apache.org/p/allura/pastebin/557b1ce16d19cd7007456025

I think a fix for this would have to include a way for commit notification logic to build the plain text version separately and pass that in to the mail functions.

Related

Tickets: #7825
Tickets: #8076
Tickets: #8157

Discussion

  • Dave Brondsema

    Dave Brondsema - 2017-07-06

    The markdown conversion of each commit msg to HTML creates <div ..... </div> sections which is good for the later conversion to HTML mail, because markdown->HTML will skip past the <div> html sections. But it's not appropriate for the plaintext

    Options:

    • instead of converting commit messages to HTML, escape the block with ``` or individual characters with backslashes.
      • wouldn't look good in plaintext mail, and HTML mail would have it as fixed-width and no markdown in commit messages would be handled
    • generate separate HTML and plaintext bodies for commit notifications
      • would have to pass new options through several layers of code, including persisting it in Notification collection
    • have special boundary delimiters and strip that during mail processing
      • the <div> tags already act like that for us, best option.
     

    Last edit: Dave Brondsema 2017-07-06
  • Dave Brondsema

    Dave Brondsema - 2017-07-06
    • status: open --> review
    • assigned_to: Dave Brondsema
     
  • Dave Brondsema

    Dave Brondsema - 2017-07-06

    Fixed fairly well on db/8157

     
  • Kenton Taylor - 2017-07-12
    • status: review --> closed
     
  • Kenton Taylor - 2017-07-12

    Merged.

     
  • Dave Brondsema

    Dave Brondsema - 2018-02-05
    • Milestone: unreleased --> v1.8.0
     

Log in to post a comment.