#18807 closed defect (bug) (fixed)
Switching from HTML to Visual messes up "samp" elements
Reported by: | jsumners | Owned by: | azaozz |
---|---|---|---|
Milestone: | 3.6 | Priority: | normal |
Severity: | normal | Version: | 3.2.1 |
Component: | Editor | Keywords: | has-patch |
Focuses: | Cc: |
Description
Type the following into the HTML editing view of a new post:
This is an example: <samp>/tmp/some.file</samp>. More text.
Now, switch to the Visual editing view and you will get:
This is an example: /tmp/some.file . More text.
The "samp" element should be treated exactly like the "code" element. See http://www.w3.org/TR/html5/text-level-semantics.html#the-samp-element for more information on the samp element.
Attachments (3)
Change History (21)
#3
@
12 years ago
The ticket needs a patch. It doesn't need to come from you necessarily, though it may speed up acceptance. I forget where all of the moving bits are here myself, otherwise I probably would have patched it as well.
#4
@
12 years ago
This seems to be a TinyMCE bug. It seems to treat <samp> as a block for some reason.
#5
@
11 years ago
- Cc info@… added
- Keywords has-patch added; needs-patch removed
This is not (just) a TinyMCE bug, samp
is part of the block element list in wpautop()
.
The attached patch removes samp
from the list of block elements.
Please set the milestone to 3.6; I just had to hack around this bug in a long document with many string examples.
#7
in reply to:
↑ 6
@
11 years ago
Replying to SergeyBiryukov:
Introduced in [17625] for the JS version and [21888] for the PHP version.
Needs to be removed from the JS version as well then.
Done. Thanks for finding this.
#8
in reply to:
↑ 6
;
follow-up:
↓ 9
@
11 years ago
Yes, currently <samp>
accepts only phasing content. Looking for the reason it was added to the blocklists, perhaps it was accepting "flow" content at the time?
#9
in reply to:
↑ 8
;
follow-up:
↓ 10
@
11 years ago
Replying to azaozz:
Looking for the reason it was added to the blocklists, perhaps it was accepting "flow" content at the time?
It was always an inline element.
#10
in reply to:
↑ 9
@
11 years ago
Replying to toscho:
Replying to azaozz:
Looking for the reason it was added to the blocklists, perhaps it was accepting "flow" content at the time?
It was always an inline element.
Exactly. It makes no sense why this was ever part of the block elements list.
#13
@
11 years ago
- Keywords commit removed
I can reproduce the original report in 3.2 and 3.6-alpha-23288.
Found an issue with the patch though: the space between example:
and <samp>
disappears when switching to Visual editor:
This is an example:<samp>/tmp/some.file</samp>. More text.
If I replace <samp>
with <code>
, the space is preserved:
This is an example: <code>/tmp/some.file</code>. More text.
#14
follow-up:
↓ 16
@
11 years ago
Hm, I missed one in wp-tinymce-schema.js
. Why are these lists spread over several files? wpautop()
and TinyMCE should use the same source for formatting.
#15
@
11 years ago
- Owner set to azaozz
- Resolution set to fixed
- Status changed from new to closed
In 23327:
I can't find any information on what the keywords mean. Does the "needs-patch" keyword mean that I need to submit a patch? If so, I wanted to do so when I created the ticket, but I was unable to figure out where the "code" element is being applied so that I could add in a check for the samp element.