Using editor fulllpost quote button on a post which uses HTML formatting mangles it


(Irrational John) #1

OK, I think this is a bug. However, if it turns out that it actually is not a bug, then I look forward learning why it isn't.

While the option of using HTML to format your entire post is possible with DIscourse, there seems to be a problem quoting from a post which used HTML as the markup language.

What appears to happen is that all of the `<` & `>` characters around the HTML tags are converted to the `<` and `>` symbols. So, `

` in the original HTML becomes `<p>` when the post is quoted. The result is that the quoted text is unformatted and IMO unreadable.

I'll provide an example of this in a reply to this post below …

Note:
How could this ever be a problem worth fixing? Who would be so insane as to create not just one, but thousands of Discourse posts using only HTML? It happened to the tudiabetes.org site. When the site was migrated from Ning to Discourse the Ning posts were copied/migrated to the Discourse site "as is" (I am guessing). This "bug" makes it infeasible to quote anything for reference from the migrated HTML posts.


(Irrational John) #2

As promised here is a quote of the original post which I had hoped would illustrate what I said happens.

OK, so I was slightly wrong. The &lt; and &gt; symbols are used in the raw text. The result is that formatted version of the quoted text contains all of the HTML tags in the OP. Ooops.

But I’ll be damned if I’m going back and editing & correcting the OP. You get the point, yes?


OK, after I had posted the above, one of my cats dope slapped me and pointed out there is an “obvious” copy’n paste workaround. Copy the quoted text shown in the preview section and use it to replace the body of the quote in the editor window. I did this below to illustrate it.

<sigh/> Still, I hope that it will turn out to be reasonable (enough) to eventually correct the way Discourse handles this. Trying to explain even this “simple” workaround to those in the “Discourse is just too damn complicated & hard for normal people to use!” chorus is not a place one wants to visit. :anguished: (Then again, maybe if no one tells the chorus about this then they just might never notice it. :smirk: )


(Sam Saffron) #3

I think the simplest fix here is to have the “quote whole post” just take raw, it will have some edge cases but will be a lot better than the alternative.


(Jens Maier) #4

I think it’d be best to remove the quote content from the post and cook it separately, keeping track of the current nesting level. That’d also solve quoted polls becoming new, distinct polls


(Jeff Atwood) #5

This is rather specific to quote whole post, and I would argue users should be discouraged from using that button in general… it is better to select just the text you want to reply to, and use the quote text button that appears over the selected text.

It is also somewhat specific to import cases where we imported as HTML, for future conversations it is extremely unlikely people will type their new posts in raw HTML.

Not opposed to some kind of workaround, but context is everything here.


(Sam Saffron) #6

I fixed this:

https://github.com/discourse/discourse/commit/66423e62dceabbb9f688569e02e5a91e3bb0201c

It will raise other edge cases, but lets live with it and see who complains


(Sam Saffron) #7

(Jeff Atwood) #8

Oh I am pretty sure I know who will :smiling_imp: