Opened 14 years ago
Last modified 14 years ago
#6771 review Bug
Strange <span> refactoring
Reported by: | Dinu | Owned by: | Garry Yao |
---|---|---|---|
Priority: | Normal | Milestone: | |
Component: | Core : Output Data | Version: | 3.3 |
Keywords: | Cc: |
Description
insertHtml('<span><br><br><span>foo</span></span>')
is refactored to
<br><br><span><span>foo</span></span>
Only seems to happen with nested spans; makes no sense since none of the tags are blocks that would require a reconsideration of line breaks
Attachments (2)
Change History (16)
comment:1 Changed 14 years ago by
Resolution: | → invalid |
---|---|
Status: | new → closed |
comment:2 follow-up: 3 Changed 14 years ago by
I see, but shouldn't this be applied just to the relevant spans for styles? like only refactor <br>'s is spans that have some _ckeditor_style flag. It does have impact where, for instance, lineHeight differs across the containers. It also has impact in the sense that it will refactor user content that is not CK-generated.
It seems to also have some more hectic effects: try api demo, type in
<span><span>foo<br /></span></span>
And click set contents... result is
<br /><p><span><span>foo</span></span>
comment:3 Changed 14 years ago by
Resolution: | invalid |
---|---|
Status: | closed → reopened |
Replying to dinu:
It seems to also have some more hectic effects: try api demo, type in
<span><span>foo<br /></span></span>
And click set contents... result is
<br /><p><span><span>foo</span></span>
This's something to check definitely...
comment:4 Changed 14 years ago by
Component: | General → Core : Output Data |
---|---|
Status: | reopened → confirmed |
Reduced TC for this parser bug:
- Load the editor with the following content:
<span>foo<br /></span>
- Check source;
- Actual Result:
<br /> <p> <span>foo</span></p>
- Expected Result:
<p> <br /><span>foo</span></p>
comment:5 follow-up: 9 Changed 14 years ago by
No, expected result should be <p><span>foo</span><br /></p> if I get your logic right... anyway, that <br /> should not climb over text.
comment:6 Changed 14 years ago by
But I still don't get it, why not just trim any leading or trailing line breaks when aplying styles, as opposed to refactoring whole code for this
comment:7 Changed 14 years ago by
4886_2 would work excellent with a very small adjustment: exclude trailing <br /> only if it is preceded by content (e.g. don't trim empty lines). IMHO <br /> refactoring makes sense only in the context of actual line-break logic (making good with <p> and <div> blocks).
comment:8 Changed 14 years ago by
With CSS3, I can imagine a number of uses that would be upset by <br>'s flying around (like special <br> styling, automatic line numberings, special rendering of consecutive br's, etc). Although in a narrow approach is just a small glitch, maybe from a design POV it deserves some attention. Sorry for the consecutive postings, I'm a compulsive writer :)
comment:9 Changed 14 years ago by
Replying to dinu:
No, expected result should be <p><span>foo</span><br /></p> if I get your logic right... anyway, that <br /> should not climb over text.
My fault, let me come with a clearer TC:
<span>foo<br /></span>bar => <p><span>foo</span><br /></p>
Changed 14 years ago by
Attachment: | 6771.patch added |
---|
comment:10 Changed 14 years ago by
Keywords: | HasPatch added |
---|
Re-propose a cleaner way to have #4886 fixed.
comment:11 Changed 14 years ago by
Version: | 3.4.3 (SVN - trunk) → 3.3 |
---|
In CKE 3.2 result was:
<p> <span>foo</span></p>
comment:12 Changed 14 years ago by
Looks dandy for my complaint. Haven't checked if it fixes #4886 but there sure ain't any more <br /> refactoring where I can see it.
comment:13 Changed 14 years ago by
Will this make it into trunk? Seems 3.5.1 introduces even more "pending br" handling
Changed 14 years ago by
Attachment: | 6771_2.patch added |
---|
comment:14 Changed 14 years ago by
Keywords: | HasPatch removed |
---|---|
Owner: | set to Garry Yao |
Status: | confirmed → review |
Nice catch, but it's our solution of keeping line-breaks out of applied inline style, and it has no wysiwyg impacts.Check #4886 for more details.