[wp-meta] [Making WordPress.org] #20: Possible for user's to break layout when adding forum posts
Making WordPress.org
noreply at wordpress.org
Thu Mar 2 06:09:07 UTC 2017
#20: Possible for user's to break layout when adding forum posts
----------------------------+------------------
Reporter: siobhyb | Owner:
Type: defect | Status: new
Priority: low | Milestone:
Component: Support Forums | Resolution:
Keywords: has-patch |
----------------------------+------------------
Changes (by SergeyBiryukov):
* keywords: => has-patch
Comment:
This was brought up in a recent
[https://wordpress.slack.com/archives/forums/p1488244959929189 Slack
discussion].
[attachment:meta-20.patch] is an experimental patch that wraps standalone
`<li>` tags in `<ul>`:
* Code blocks are not affected, as they are htmlencoded earlier.
* The filter runs on output, so user input is intact.
See before/after screenshots.
=== Test 1, from @netweb's [https://wordpress.org/support/topic/code-
blocks-ordered-lists/ Code Blocks & Ordered Lists] ===
Input:
{{{
<li>
<ol>
first
</ol>
<ol>
second
</ol>
</li>
}}}
Output:
{{{
<ul><li>
<ol>
first
</ol>
<ol>
second
</ol>
</li>
</ul>
}}}
=== Test 2 ===
Input:
{{{
<ul>
<li>Unordered list item
</ul>
<ol>
<li>Ordered list item
</ol>
<li>
Code block:
`
<li>List item inside code block
`
}}}
Output:
{{{
<ul>
<li>Unordered list item
</li>
</ul>
<ol>
<li>Ordered list item
</li>
</ol>
<ul><li>
Code block:
<pre><code>
<li>List item inside code block
</code></pre>
</li>
</ul>
}}}
This would need some unit test coverage, but the direction seems correct.
--
Ticket URL: <https://meta.trac.wordpress.org/ticket/20#comment:3>
Making WordPress.org <https://meta.trac.wordpress.org/>
Making WordPress.org
More information about the wp-meta
mailing list