Edgewall Software
Modify

Opened 10 years ago

Last modified 15 months ago

#12054 new defect

Normalize newline of wiki text to CRLF on initenv, saving wiki and fetching wiki

Reported by: Jun Omae Owned by:
Priority: normal Milestone: next-stable-1.6.x
Component: wiki system Version:
Severity: normal Keywords:
Cc: Branch:
Release Notes:
API Changes:
Internal Changes:

Description

Currently, Trac creates default pages with LF as newline on initenv. However, browsers send request with CRLFs for newline in textarea elements. Therefore, Trac creates a new version of the page even if the page is saved without changes.

>>> v1 = WikiPage(env, 'WikiStart', 1)
>>> v2 = WikiPage(env, 'WikiStart', 2)
>>> v1.text[:40]
u"= Welcome to Trac 1.0.5 =\n\nTrac is a '''"
>>> v2.text[:40]
u"= Welcome to Trac 1.0.5 =\r\n\r\nTrac is a '"
>>> v1.text.replace('\n', '\r\n') == v2.text
True

I think we should normalize newlines in text of wiki page on initenv, saving wiki and fetching wiki.

Attachments (0)

Change History (5)

comment:1 by Jun Omae, 10 years ago

The same issue occurs when ticket comment is added via CommitTicketUpdater and it's edited.

comment:2 by Ryan J Ollos, 10 years ago

Summary: Normalize newline of wiki text to CRLF on initenv, saving wiki and fetchting wikiNormalize newline of wiki text to CRLF on initenv, saving wiki and fetching wiki

comment:3 by Ryan J Ollos, 8 years ago

Milestone: next-stable-1.0.xnext-stable-1.2.x

Moved ticket assigned to next-stable-1.0.x since maintenance of 1.0.x is coming to a close. Please move the ticket back if it's critical to fix on 1.0.x.

comment:4 by Ryan J Ollos, 5 years ago

Milestone: next-stable-1.2.xnext-stable-1.4.x

comment:5 by Ryan J Ollos, 15 months ago

Milestone: next-stable-1.4.xnext-stable-1.6.x

Milestone renamed

Modify Ticket

Change Properties
Set your email in Preferences
Action
as new The ticket will remain with no owner.
The ticket will be disowned.
as The resolution will be set. Next status will be 'closed'.
The owner will be changed from (none) to anonymous. Next status will be 'assigned'.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.