Created attachment 262464 [details] [diff] [review]
Right now we do this only when nsIDocumentEncoder::OutputFormatted is set. But unlike the other formatting (* * for bold, _ _ for underline, etc) that we can output, quotes should really be added to <q> unconditionally; these characters are not just a convention to indicate bolding or underlining but what <q> really _means_.
As a side effect, a selection that actually contains part of a <q> will put quotes around that part when pasted into a plaintext context. This is, imo, desirable.
Note that this is NOT a duplicate of bug 12460. That kettle of fish is something else entirely.
> As a side effect, a selection that actually contains part of a <q> will put
> quotes around that part when pasted into a plaintext context. This is, imo,
I disagree. I frequently paste sentences from web pages into IRC or AIM or del.icio.us by typing: double-quote, Cmd+V, double-quote. I don't want to be surprised by extra quotes when I paste from a site that happens to use the <q> tag around a (more complete) quote.
> I disagree.
I'm not sure you understood the setup that will ensue with this patch. If the selection is entirely within the <q>, there will be no quotes added. But if part of the selection is inside the <q> and part is outside, the part that was inside will get quoted.
One thing I _am_ worried about here is i18n. This patch always adds English quotes. I'm not sure whether that's desirable, or whether we should add quotes based on default locale or page language or whatnot...
> If part of the selection is inside the <q> and part is outside, the part
> that was inside will get quoted.
Oh. That's fine, I think.
Comment on attachment 262464 [details] [diff] [review]
Yes. But what is NOT ok is the total lack of internationalization of this serialization. If english and US english use double quotes around <q>, french uses «...» or sometimes ”...„
We know how to do it for <q>'s rendering, we should be able to do it too for the plaintext serialization.
I recommend filing another bug immediately for that.
Yeah, indeed. Filed bug 383343.
Checked in. Still need a unit test...
In particular, we need a scriptable way to create HTML documents. I _think_ we have a scriptable way to do plaintext serialization.
*** Bug 415758 has been marked as a duplicate of this bug. ***