TiddlyWiki.org

Ticket #357 (new defect)

Opened 1 year ago

Last modified 11 months ago

initial newline in tiddler content lost after save-and-reload

Reported by: EricShulman Assigned to:
Priority: undefined Milestone: soon
Component: core Version:
Severity: undefined Keywords:
Cc:

Description

Steps to reproduce:

1) Open an empty TW.html 2) Create a test tiddler 3) Enter 3 newlines and then some text 4) 'done' 5) save-and-reload 7) only TWO blank lines remain at start of test tiddler 8) save-and-reload 9) only ONE blank line... 10) save-and-reload 11) NO blank lines left

note: it only eats a single newline each time... leading whitespace is preserved, as are all non-whitepspace characters.

Attachments

Ticket357.patch (1.1 kB) - added by SaqImtiaz on 25/06/07 15:30:50.
Fix for dropped leading and trailing new lines.

Change History

20/06/07 23:56:33 changed by SaqImtiaz

The new line is stripped when loading the TW, and not when saving.

Firefox and Firebug show that a file with the following <pre> in a tiddler in the store:

<pre>
This is on the second line</pre>

renders as:

<pre>This is on the second line</pre>

Internet Explorer, has the same problem.

25/06/07 15:30:50 changed by SaqImtiaz

  • attachment Ticket357.patch added.

Fix for dropped leading and trailing new lines.

25/06/07 15:32:11 changed by SaqImtiaz

The attached patch has been tested in FF2 and IE6 and solves this problem. The approach is to escape the first and last line break in the tiddler text, if present, when saving. Similarly, when loading the tiddler text, the same line breaks are unescaped if present.

Testing on IE7 and Safari is welcomed.

20/07/07 11:28:55 changed by MartinBudden

12/10/07 16:58:24 changed by MartinBudden

  • version deleted.
  • milestone changed from unscheduled to soon.