[wp-trac] [WordPress Trac] #30727: Right Arrow ">" At Beginning of Line (For Markdown Quote) is Replaced when Switching Editors
WordPress Trac
noreply at wordpress.org
Mon Dec 29 20:38:32 UTC 2014
#30727: Right Arrow ">" At Beginning of Line (For Markdown Quote) is Replaced when
Switching Editors
--------------------------+------------------------------
Reporter: Kelderic | Owner:
Type: defect (bug) | Status: reopened
Priority: normal | Milestone: Awaiting Review
Component: Editor | Version:
Severity: minor | Resolution:
Keywords: has-patch | Focuses:
--------------------------+------------------------------
Comment (by azaozz):
Replying to [comment:12 Kelderic]:
> If a right arrow is the first character of a line, it can't be part of
an HTML element, and the same could be said of right arrows with spaces in
front.
[http://www.w3.org/TR/html5/infrastructure.html#space-character Space
characters] (including new line U+000A and space U+0020) are allowed
before `>` in start and end HTML tags: http://www.w3.org/TR/html-
markup/syntax.html#syntax-start-tags and
http://www.w3.org/TR/html5/syntax.html#syntax-start-tag.
These are all valid HTML:
{{{
<p
id="some"
>
}}}
{{{
<p id="some" >
}}}
{{{
</p
>
}}}
It's true "stray" `>` are allowed in text content, however they will trip
many other functions that don't expect them. If it's any indication, when
using contentEditable all browsers encode all `>` chars.
If you're trying to implement Markdown support in TinyMCE, perhaps have a
look at
https://github.com/tinymce/tinymce/blob/master/js/tinymce/plugins/textpattern/plugin.js
which converts some of the Markdown syntax to HTML on the fly.
If you're implementing Markdown from PHP, I'd suggest replacing `\n>`
with `\n>` before processing.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/30727#comment:17>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list