Last Comment Bug 378407 - [FIX]Plaintext serialization of <q> should always add quotes
: [FIX]Plaintext serialization of <q> should always add quotes
Status: RESOLVED FIXED
:
Product: Core
Classification: Components
Component: Serializers (show other bugs)
: Trunk
: x86 Linux
: -- normal (vote)
: mozilla1.9alpha6
Assigned To: Boris Zbarsky [:bz] (still a bit busy)
:
: Andrew Overholt [:overholt]
Mentors:
: 415758 (view as bug list)
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2007-04-22 17:14 PDT by Boris Zbarsky [:bz] (still a bit busy)
Modified: 2008-02-06 03:08 PST (History)
5 users (show)
bzbarsky: in‑testsuite?
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
Proposed change (2.96 KB, patch)
2007-04-22 17:14 PDT, Boris Zbarsky [:bz] (still a bit busy)
daniel: review+
jonas: superreview+
Details | Diff | Splinter Review

Description Boris Zbarsky [:bz] (still a bit busy) 2007-04-22 17:14:17 PDT
Created attachment 262464 [details] [diff] [review]
Proposed change

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.
Comment 1 Jesse Ruderman 2007-04-23 10:11:18 PDT
> 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.

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.
Comment 2 Boris Zbarsky [:bz] (still a bit busy) 2007-04-23 11:04:52 PDT
> 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...
Comment 3 Jesse Ruderman 2007-04-23 11:37:44 PDT
> 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 4 Daniel Glazman (:glazou) 2007-06-05 11:59:52 PDT
Comment on attachment 262464 [details] [diff] [review]
Proposed change

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.

r=danie@glazman.rgo
Comment 5 Boris Zbarsky [:bz] (still a bit busy) 2007-06-05 12:22:30 PDT
Yeah, indeed.  Filed bug 383343.
Comment 6 Boris Zbarsky [:bz] (still a bit busy) 2007-06-05 12:25:10 PDT
Checked in.  Still need a unit test...
Comment 7 Boris Zbarsky [:bz] (still a bit busy) 2007-06-05 12:30:51 PDT
In particular, we need a scriptable way to create HTML documents.  I _think_ we have a scriptable way to do plaintext serialization.
Comment 8 timeless 2008-02-06 03:08:04 PST
*** Bug 415758 has been marked as a duplicate of this bug. ***

Note You need to log in before you can comment on or make changes to this bug.