When the OEmbedFilter runs, it splits lines with a regular expression that will accidentally grab a character. When it joins the text back together the character is removed.
Repro Steps:
1. Create a paragraph
2. Edit as HTML
3. Paste this in
<p>
Test
X
Y
</p>5. Save
The X and Y will be removed.
I'm not sure why it's not just splitting on \n and joining on \n. If there's a reason to grab a character before the \n then matching a space seems safe (See the attached patch). Otherwise I'd just split on \n.
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | 3108929-oembed-filter-split-fix.patch | 568 bytes | onedotover |
Comments
Comment #2
onedotover commentedComment #3
codebymikey commentedI'm still interested to know why most of the filters have been implemented as regex's rather than parsing the DOM like all of the core plugins do using an XPath query - It's less likely to run into bugs like this where the HTML is an unexpected format, and leads to more maintainable code.
Comment #5
thorandre commentedThis issue has been fixed in later updates.
Tested and working.
Comment #6
thorandre commented