Opened 9 years ago

Closed 9 years ago

#10854 closed defect (fixed)

Pretty Print causes content to disappear

Reported by: roaming Owned by: Jared Jurkiewicz
Priority: high Milestone: 1.5
Component: Editor Version: 1.4.2
Keywords: Cc:
Blocked By: Blocking:

Description

How to reproduce:

  1. start with empty editor with prettyprint enabled
  1. type a single word (do not hit space or return, although this varies by browser)
  1. click on View Source icon

The view source box will be empty, and upon return from View Source, the Editor will be empty. The behavior is slightly different between browsers. In Firefox 3.6 if you type a space or hit return after the word, there is a br tag added and content does not disappear. In Webkit-based browsers (Safari, Chrome - latest versions), typing a space doesn't help. You have to hit return.

(Probably unrelated, but I also noticed that Webkit-based browsers wrap the br tag between div tags. This doesn't happen in Firefox.)

I'm not attaching a test case because this can be easily reproduced using the dojox/editor/tests/editorPrettyPrint.html page (you have to clear the existing content in View Source mode, and then enter new content).

Change History (4)

comment:1 Changed 9 years ago by bill

Component: GeneralEditor
Owner: changed from anonymous to Jared Jurkiewicz

comment:2 Changed 9 years ago by Jared Jurkiewicz

The BR is unrelated.

The issue turned out to be a trivial one. When there was trailing text content (no ending tag), the content would be dropped because it wasn't formatted and joined into the array at the end. Minor fix. Working on it now, should have it fixed in 10 minutes or so.

comment:3 Changed 9 years ago by Jared Jurkiewicz

Milestone: tbd1.5

comment:4 Changed 9 years ago by Jared Jurkiewicz

Resolution: fixed
Status: newclosed

(In [21596]) Fixing minor issue in prettyPrint function. fixes #10854

Note: See TracTickets for help on using tickets.