Opened 11 years ago
Closed 6 years ago
#29171 closed defect (bug) (worksforme)
empty (and valid) span tags are removed when switching from visual to text editor and back to visual
Reported by: |
|
Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | 3.9 |
Component: | TinyMCE | Keywords: | has-patch needs-testing |
Focuses: | Cc: |
Description
Forwarded from #28940, related #27391.
The difference with #27391 is that when I tried to use a Bootstrap 3 Glyphicon approach while having the 28940.patch installed the editor removes the (empty) span tag. The span tag doesn't use any new schema type of attribute, just a regular class.
(see http://getbootstrap.com/components/ Glyphicons, How to use for testing)
Attachments (2)
Change History (15)
#4
@
10 years ago
I've tested trunk (with and without 28940.patch installed), and empty spans are always stripped out when switching from text to visual and back (with or without class, etc).
I've tried trunk with your attachment:29171.patch patch, and it did not make a difference, empty spans are still being stripped: https://cloudup.com/couAlDKgtGu
Am I missing something?
This ticket was mentioned in IRC in #wordpress-dev by stephdau. View the logs.
10 years ago
#7
@
10 years ago
Hi Stephdau, thanks for checking the patch.
I've watched your video, it is stripping empty span tags as it should.
You describe that spans with classes also get stripped out.
Did you test that case after you applied the patch?
The patch is supposed to fix exactly that.
#9
@
8 years ago
- Keywords dev-feedback removed
- Milestone changed from Awaiting Review to 4.9
29171.patch looks good but maybe better to not use
for padding. It is "visible" in the editor and the element can still be considered "empty". Thinking it's better to use <wbr />
as it doesn't affect the element at all and is easy to deal with both in the DOM and in the HTML.
In 29171.2.patch: use <wbr />
to pad empty spans and links so they are not removed on editor cleanup.
This ticket was mentioned in Slack in #core by westonruter. View the logs.
8 years ago
This ticket was mentioned in Slack in #core by melchoyce. View the logs.
7 years ago
#13
@
6 years ago
- Milestone Future Release deleted
- Resolution set to worksforme
- Status changed from new to closed
Similarly to #28940, this is now superseded by the block editor. Closing as worksforme, please feel free to reopen if it makes sense to attempt to fix this in TinyMCE.
The proposed fixes above (padding empty spans inside the contenteditable area) should still work but would potentially bring edge cases in Chromium browsers as they are known to insert many empty spans in certain cases.
Modified 28940.patch to create this patch.