Last Comment Bug 265971 - \n in SUMMARY of VEVENT not interpreted
: \n in SUMMARY of VEVENT not interpreted
Status: VERIFIED FIXED
[needed beta][no l10n impact]
:
Product: Calendar
Classification: Client Software
Component: Internal Components (show other bugs)
: unspecified
: All All
: -- normal with 1 vote (vote)
: 1.0b2
Assigned To: Alexander Shvetsov
:
Mentors:
: 401872 (view as bug list)
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2004-10-25 07:59 PDT by Hadmut Danisch
Modified: 2010-05-16 14:08 PDT (History)
7 users (show)
philipp: blocking‑calendar1.0+
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---


Attachments
[checked in] Preserve newlines in iMIP display (1.14 KB, patch)
2008-02-13 15:15 PST, Christian Schmidt
cmtalbert: review+
Details | Diff | Review
ics file (818 bytes, text/plain)
2008-07-15 05:36 PDT, Daniel Boelzle [:dbo]
no flags Details
Representation of SUMMARY with '\n' in different views (29.10 KB, image/png)
2009-10-22 03:29 PDT, Alexander Shvetsov
no flags Details
Inline edit of SUMMARY with '\n' (Lightning & Sunbird, Windows & Linux) (48.84 KB, image/x-xcf)
2009-10-22 03:43 PDT, Alexander Shvetsov
no flags Details
Fix SUMMARY with '\n' viewing (2.74 KB, patch)
2009-10-22 04:13 PDT, Alexander Shvetsov
philipp: review+
Details | Diff | Review
Replace for bad picture 407740. Sorry (19.13 KB, image/png)
2009-10-22 04:17 PDT, Alexander Shvetsov
no flags Details
Regression Fix - v1 (5.02 KB, patch)
2010-05-11 10:35 PDT, Philipp Kewisch [:Fallen]
no flags Details | Diff | Review
Regression Fix - v2 (5.02 KB, patch)
2010-05-12 03:05 PDT, Philipp Kewisch [:Fallen]
nomisvai: review+
Details | Diff | Review

Description Hadmut Danisch 2004-10-25 07:59:21 PDT
User-Agent:       Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.3) Gecko/20041007 Debian/1.7.3-5
Build Identifier: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.3) Gecko/20041007 Debian/1.7.3-5

When displaying an internet ics calender file, newlines are not displayed 
correctly. If a text line (e.g. DESCRIPTION or SUMMARY) contains a 
\n Mozilla displays a box with "00 0A" instead of starting a new line.

regards
Hadmut


Reproducible: Always
Steps to Reproduce:
1. Use the given URL as a calender
2. Watch Nov 8 2004
3.

Actual Results:  
a box with "00 0a"

Expected Results:  
A new line
Comment 1 Michael 2004-11-08 12:00:13 PST
In whic field are you teying to place the \n?  Subject or the description...  I
have it working fine in the description and other text fields, but within the
subject it gives me this results.  The question is:  A subject allowed to have
multiple lines?

If you import this ics into Outlook or other program does it put multiplt lines?

PHPiCalendar work fine with a \n in the subject, but it doe snot let you see the
data after the \n.

Outlook gives you multiple lines, but you can not add additional lines within
outlook.
Comment 2 Michael 2004-11-08 12:03:33 PST
Sorry, I use the work subject vs. summary.  I ment summary.

Within the RFC 2048 spec, it only inticates the field as TEXT.  I did not find
any adidional text limiting the summary field to one line.
Comment 3 Hadmut Danisch 2004-11-15 11:36:02 PST
Hi,

sorry for the delay, I was out of home.

Just see the example given at the  URL. Both the 
summaries and descriptions contain \n. 

Other Calendar tools (e.g. evolution) display it correctly. 

See also bug 251771 for screenshots.

regards
Hadmut
Comment 4 Martin Schröder [:mschroeder] 2006-04-21 13:43:32 PDT
Current situation in Sunbird nightly builds:
In the event dialog we only show one line and see the text before the first '\n'. In the unifinder the complete SUMMARY string is showed, but with black squares instead of the '\n' (under WinXP). The views and the tooltips show the complete SUMMARY string but ignore and omit the '\n'.
Comment 5 Dan Mosedale (:dmose) 2006-04-21 14:40:46 PDT
Presumably, this causes dataloss when editing a bug.
Comment 6 Reed Loden [:reed] (use needinfo?) 2006-07-19 21:09:18 PDT
The bugspam monkeys have struck again. They are currently chewing on default assignees for Calendar. Be afraid for your sanity!
Comment 7 Dan Mosedale (:dmose) 2006-09-12 12:29:42 PDT
Marked as blocking0.3 in part because the fix seems like it should be easy.  If that turns out to not be true, we may need to reconsider.
Comment 8 Dan Mosedale (:dmose) 2006-09-12 12:47:46 PDT
After more discussion, we've realized that is arguably not even dataloss, since \n
is actually interpreted in the event dialog these days, so it will be round-tripped, so we're not going to let this block 0.3.

One could imagine a scenario where someone selects stuff with the mouse and thinks that everything is selected, when in fact, everything is not visible, but this seems a total edge case.

We've come up with UI for the event dialog part of this bug, which is to make it the text box be one line tall, but allow a scrollbar to created on overflow.  We'd want to make it hard or impossible for the user to manually add lines to the summary, the overflow would be just to deal with existing data that had this.  Probably a keypress handler would do the trick.

We would be inclined to accept a patch of this nature for 0.3.
Comment 9 Matthew (lilmatt) Willis 2007-02-28 17:55:32 PST
Not going to make the 0.5 train. Moving forward.
Comment 10 Mauro Cicognini 2007-11-12 03:24:54 PST
The proposed solution of making it impossible to add more than one line seems more of a workaround to me, and besides, other tools (i.e. GCalendar) we already have a provider for don't set this restriction, so we could easily end up with events with newlines in them.

As stated in bug 401872, I'd be happy to tackle the issue.
Anyone available to assign me this bug?
Comment 11 Philipp Kewisch [:Fallen] 2007-11-12 07:15:27 PST
*** Bug 401872 has been marked as a duplicate of this bug. ***
Comment 12 Simon Paquet [:sipaq] 2007-11-24 12:04:54 PST
Setting wanted0.8- as the main Calendar developers will not devote any time to
this in the 0.8 timeframe. Patches are, of course, always welcome.
Comment 13 Christian Schmidt 2008-02-13 15:15:55 PST
Created attachment 303139 [details] [diff] [review]
[checked in] Preserve newlines in iMIP display

With this patch newlines are preserved when viewing an iMIP invitation.
Comment 14 cmtalbert 2008-02-17 00:06:00 PST
Comment on attachment 303139 [details] [diff] [review]
[checked in] Preserve newlines in iMIP display

Tested it, looks good. r=ctalbert  

Thanks for the patch!!!
Comment 15 cmtalbert 2008-02-17 00:13:18 PST
Fix checked in on trunk and MOZILLA_1_8_BRANCH --> FIXED
Comment 16 Martin Schröder [:mschroeder] 2008-02-17 02:39:20 PST
I'm not convinced the bug is fixed. The issues from comment#4 were not connected to iTIP/iMIP.
Comment 17 Martin Schröder [:mschroeder] 2008-05-11 16:45:43 PDT
(In reply to comment #16)
> I'm not convinced the bug is fixed. The issues from comment#4 were not
> connected to iTIP/iMIP.

-> Re-opening
Comment 18 Daniel Boelzle [:dbo] 2008-05-18 08:09:31 PDT
This WFM on Mac using the new/prototype event dialog, thus I think the iTIP fix was the only missing piece. Martin, could you please verify on Windows?
Comment 19 Daniel Boelzle [:dbo] 2008-06-19 07:19:17 PDT
Martin, any update?
Comment 20 Martin Schröder [:mschroeder] 2008-07-15 03:18:08 PDT
In the event dialog '\n' is substituted with ',', the unifinder shows some box char, and the calendar views do different things: Day/Week view shows a space, Multiweek/Month shows the same box char as the unifinder.
Comment 21 Daniel Boelzle [:dbo] 2008-07-15 05:36:43 PDT
Created attachment 329664 [details]
ics file

Seems I am missing the point, but subscribing to an ics file containing \n, those are correctly broken into different lines. Could somebody explain what's still missing?
Comment 22 Martin Schröder [:mschroeder] 2008-07-15 05:51:27 PDT
> Seems I am missing the point, but subscribing to an ics file containing \n,
> those are correctly broken into different lines. Could somebody explain what's
> still missing?

Daniel, I think you mixed up SUMMARY and DESCRIPTION of an event. This bug report concerns the SUMMARY of an iCalendar VEVENT, not the DESCRIPTION, i.e. what contains '\n' in your attached ics file.
Comment 23 Daniel Boelzle [:dbo] 2008-07-15 08:02:16 PDT
Ah! Yes, of course. Thanks, Martin.
Comment 24 Daniel Boelzle [:dbo] 2008-07-15 08:05:14 PDT
Even though this is rather exotic (since you cannot edit multi-line titles), what about only showing the first line? Christian, what do you think?
Comment 25 Christian Jansen 2008-07-22 00:21:52 PDT
Would be ok for me. Maybe we can show ellipses at the end and on mouse over a tooltip which contains the whole summary.
Comment 26 Alexander Shvetsov 2009-10-22 03:29:24 PDT
Created attachment 407738 [details]
Representation of SUMMARY with '\n' in different views
Comment 27 Alexander Shvetsov 2009-10-22 03:43:49 PDT
Created attachment 407740 [details]
Inline edit of SUMMARY with '\n' (Lightning & Sunbird, Windows & Linux)

Solution may be divided in 2 steps:
1. Ensure consitent viewing.
\n converts to ' ' in Day and Month views. And it simply eliminates in all other places (see previous attachment).

2. Ensure consitsent editing.
Lightning replaces \n to ',' on Windows and Linux/
Sunbird on Windows allows multiline editing. But on Windows retain only first line (see attachment)
Comment 28 Alexander Shvetsov 2009-10-22 04:13:21 PDT
Created attachment 407742 [details] [diff] [review]
Fix SUMMARY with '\n' viewing

Simply replace \n with ' '

The only XUL element used to display SUMMARY that honor '\n' is <description>. All others just cut it regardless of css.

IMHO it would be better to replace \n with ' ' than all other ways. 
Comma will be unappropriate if line ends with dot. 
Preserve only first line can be misleading.
Comment 29 Alexander Shvetsov 2009-10-22 04:17:24 PDT
Created attachment 407743 [details]
Replace for bad picture 407740. Sorry
Comment 30 Martin Schröder [:mschroeder] 2010-03-21 13:25:16 PDT
Comment on attachment 407742 [details] [diff] [review]
Fix SUMMARY with '\n' viewing

Shifting review to Philipp ;-)
Comment 31 Philipp Kewisch [:Fallen] 2010-03-21 13:49:03 PDT
Comment on attachment 407742 [details] [diff] [review]
Fix SUMMARY with '\n' viewing

The patch looks fine, but what about other whitespaces? i.e if it contains \r\n ? I'll r+ with this question answered
Comment 32 Martin Schröder [:mschroeder] 2010-03-21 14:12:22 PDT
(In reply to comment #31)
> (From update of attachment 407742 [details] [diff] [review])
> The patch looks fine, but what about other whitespaces? i.e if it contains \r\n
> ? I'll r+ with this question answered

Everything that visually produces a line break should be substituted with a single space imo.
Comment 33 Philipp Kewisch [:Fallen] 2010-03-26 12:57:08 PDT
Comment on attachment 407742 [details] [diff] [review]
Fix SUMMARY with '\n' viewing

I've tested all unicode characters noted as whitespace on http://en.wikipedia.org/wiki/Whitespace_character

Only the newline character produces a visual newline. Therefore I think we can take this patch.

Even if \r\n is shortened to \r, the \r is just shown as an empty character.

r=philipp
Comment 34 Philipp Kewisch [:Fallen] 2010-03-26 13:01:34 PDT
Pushed to comm-central <http://hg.mozilla.org/comm-central/rev/0a7b207c9030>
-> FIXED
Comment 35 Simon Vaillancourt 2010-03-30 14:34:41 PDT
I am reopening this bug because it causes a regression, when the title is not present this is logged in the error console:
Error: calendarEvent.title is null
Source File: chrome://calendar/content/calendar-unifinder.js
Line: 786
Comment 36 Philipp Kewisch [:Fallen] 2010-04-02 09:43:16 PDT
Interesting, I always thought an empty title would cause an empty string, not null. Alexander, could you prepare a patch to fix this issue?
Comment 37 Philipp Kewisch [:Fallen] 2010-05-11 10:35:44 PDT
Created attachment 444693 [details] [diff] [review]
Regression Fix - v1

This fixes the regression. Simon, could you do a quick review on this one?
Comment 38 Philipp Kewisch [:Fallen] 2010-05-12 03:05:05 PDT
Created attachment 444851 [details] [diff] [review]
Regression Fix - v2

Forgot to qref, sorry
Comment 39 Simon Vaillancourt 2010-05-14 08:22:25 PDT
Comment on attachment 444851 [details] [diff] [review]
Regression Fix - v2

Works fine for me
Comment 40 Philipp Kewisch [:Fallen] 2010-05-15 10:30:25 PDT
Pushed to comm-central <http://hg.mozilla.org/comm-central/rev/987baad2b6cd>
-> FIXED
Comment 41 Philipp Kewisch [:Fallen] 2010-05-15 10:32:49 PDT
Pushed to comm-1.9.2 <http://hg.mozilla.org/releases/comm-1.9.2/rev/b5456784de23>
-> FIXED
Comment 42 Damian Szczepanik 2010-05-16 06:59:40 PDT
verified with
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1.11pre) Gecko/20100514 Calendar/1.0b2pre
Comment 43 Stefan Sitter 2010-05-16 14:08:44 PDT
(In reply to comment #42)

Damian, please remember that the Sunbird builds are still based on the 1.9.1 branch. None of the patches that were checked in after the 1.0 Beta 1 release are contained in this builds.

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