Opened 17 years ago
Closed 17 years ago
#3585 closed Bug (fixed)
Inconsistent formatting of source code
| Reported by: | Alfonso Martínez de Lizarrondo | Owned by: | Garry Yao |
|---|---|---|---|
| Priority: | Normal | Milestone: | CKEditor 3.0 |
| Component: | Core : Output Data | Version: | SVN (CKEditor) - OLD |
| Keywords: | Confirmed Review+ | Cc: |
Description
- Load the Ajax example in Firefox.
- Switch to source mode. it shows
<p> <br /> </p>
- Switch to design and back to source. The formatting has changed
<p> <br /> </p>
(the closing </p> now is indented)
Attachments (3)
Change History (10)
comment:1 Changed 17 years ago by
| Keywords: | Confirmed added |
|---|---|
| Milestone: | → CKEditor 3.0 |
| Owner: | set to Garry Yao |
| Status: | new → assigned |
Changed 17 years ago by
| Attachment: | 3585.patch added |
|---|
comment:2 Changed 17 years ago by
| Keywords: | Review? added |
|---|
Changed 17 years ago by
| Attachment: | 3585_2.patch added |
|---|
comment:4 Changed 17 years ago by
| Keywords: | Review- added; Review? removed |
|---|
We could try a simpler approach here. When closing a tag, we could simply check if its an block(like) tag, and them check if the last child of it is a text node. In that case, we simply rtrim it, and eventually remove it if it becomes empty after trimming.
This check is supposed to happen after line 249 on fragment.js (at revision 3564).
Changed 17 years ago by
| Attachment: | 3585_3.patch added |
|---|
comment:5 Changed 17 years ago by
| Keywords: | Review? added; Review- removed |
|---|
The new patch used an simplified way to right trim the block tail spaces, the check is happened inside addElement function to make sure it works even for the wrapper paragraph introduced by fix body.
comment:6 Changed 17 years ago by
| Keywords: | Review+ added; Review? removed |
|---|

The current parser already has a way of removing head spaces,now the proposed patch make the parser awareness of the tail spaces by pending each text node, both of them could guarantee that the writer won't confuse these formatting spaces with user spaces, to correctly indent the output of a element, one example: If input as:
Basic writer normalize it into:
Html writer format it as :