#5693 Last paragraph in Allura notification mails about forum posts is <h2> in HTML

v1.0.0
closed
nobody
42cc (432)
General
Cory Johns
2015-08-20
2013-01-25
Anonymous
No

Originally created by: kambi

When sending notification mails about forum posts, Allura appends at the end text like

---
[thread title](thread link)

This means that the paragraph above will be accidentally processed by Markdown as a header (< h2 >).

For example, consider this discussion thread https://sourceforge.net/p/castle-engine/discussion/general/thread/e17a79e1/ . The last paragraph of 2nd post says "I also fixed the deprecated usage of CreateCamera that you can see mentioned in FPC messages."

Now when Allura sends me a notification mail about this forum post, it looks like this in text version:

I also fixed the deprecated usage of CreateCamera that you can see mentioned in FPC messages.
---
[Error compiling SVN example with "make examples"](https://sourceforge.net/p/castle-engine/discussion/general/thread/e17a79e1/?limit=25#c927)

---

Sent from sourceforge.net because you indicated interest in <https://sourceforge.net/p/castle-engine/discussion/general/>

To unsubscribe from further messages, please visit <https://sourceforge.net/auth/prefs/>

And like this in HTML version:

<h2 id="...">I also fixed the deprecated usage of CreateCamera that you can see mentioned in FPC messages.</h2>
<p><a class="" href="https://sourceforge.net/p/castle-engine/discussion/general/thread/e17a79e1/?limit=25#c927">Error compiling SVN example with "make examples"</a></p>
<hr />
<p>Sent from sourceforge.net because you indicated interest in <a href="https://sourceforge.net/p/castle-engine/discussion/general/">https://sourceforge.net/p/castle-engine/discussion/general/</a></p>
<p>To unsubscribe from further messages, please visit <a href="https://sourceforge.net/auth/prefs/">https://sourceforge.net/auth/prefs/</a></p></div>

The HTML version of the email was obviously prepared by processing text version with Markdown. And the "---" (appended automatically by Allura) caused the paragraph "I also fixed the deprecated usage" to be surrounded by < h2 >, since this is how you make headers using Markdown.

A trivial solution would probably be to just add a newline before the "---" that is appended by Allura.

Related

Tickets: #5474
Tickets: #5620
Tickets: #5693

Discussion

  • Anonymous - 2013-01-25

    Originally by: kambi

    Another bug, that can be seen in the notification mail about this bugreport, is that apparently

    <h2>
    

    is processed as a header too by Markdown (although it seems undocumented in "Formatting help"). And it is also catched inside the bugreport title, displayed in HTML notification about this bugreport. I'm attaching an image how the HTML email notification about this bugreport looks like --- the title is accidentaly broken and a header is added.

    I understand that this probably deserves a separate bug, but the cause is similar --- you automatically construct an email message by concatenating some strings (some of which are prepared for Markdown, some not --- like bugreport title) and then you blindly process them as a whole with Markdown.

     
  • Dave Brondsema

    Dave Brondsema - 2013-06-26
    • labels: --> 42cc
    • Milestone: limbo --> forge-backlog
     
  • Igor Bondarenko - 2013-06-27
    • status: open --> in-progress
     
  • Igor Bondarenko - 2013-06-27

    Created #382: [#5693] Last paragraph in Allura notification mails about forum posts is <h2> in HTML (1cp)

     

    Related

    Tickets: #5693

  • Igor Bondarenko - 2013-06-27

    Seems like some tags are allowed in our markdown converter. Should we disable them all or they are needed for more flexibility in formatting?

     
  • Dave Brondsema

    Dave Brondsema - 2013-06-27

    My understanding was that the root cause here was the markdown text that Allura uses to construct the email uses --- which creates a <h2>, not that there was an <h2> in the user's input.

    That said, I noticed on this ticket we have <h2> in summary line and it ends up rendering as a real <h2> in email notifications. We should allow <h2> in markdown, it is useful; but we could keep titles/summary lines as non-markdown since they are are just a single line and people don't really put markdown into a ticket summary or forum thread title. I'm guessing this would be a matter of escaping the summary line when inserting it into the email notification.

     
  • Igor Bondarenko - 2013-06-28
    • status: in-progress --> code-review
     
  • Igor Bondarenko - 2013-06-28

    Closed #382. je/42cc_5693

     
  • Cory Johns - 2013-07-01
    • QA: Cory Johns
     
  • Cory Johns - 2013-07-01
    • status: code-review --> open
     
  • Cory Johns - 2013-07-01

    The summary-line escaping is not working correctly. Creating a topic with a summary of:

    this is <h2> o'clock
    

    ends up with this in the email:

    <p><a class="" href="...">this is <h2> o'clock</h2></a></p>
    

    It should be this instead:

    <p><a class="" href="...">this is &lt;h2&gt; o'clock</a></p>
    
     
  • Igor Bondarenko - 2013-07-02
    • status: open --> in-progress
     
  • Igor Bondarenko - 2013-07-02

    I believe we've escaped summary-line only for tickets. Created a ticket to fix this:

    #397: [#5693] Summary escaping for discussion notification emails (1cp)

     

    Related

    Tickets: #5693

  • Igor Bondarenko - 2013-07-03
    • status: in-progress --> code-review
     
  • Igor Bondarenko - 2013-07-03

    Closed #397.

    je/42cc_5693 (forced update)

     
  • Cory Johns - 2013-07-03
    • status: code-review --> closed
    • Milestone: forge-backlog --> forge-jul-12
     

Log in to post a comment.