Visual Editor preserves multiple sequential spaces, fouls up shortcode parsing
|Reported by:||markjaquith||Owned by:||anonymous|
The Visual Editor (TinyMCE) preserves multiple sequential spaces by turning the second (and following) spaces into some sort of funky invisible hard-space character. Unfortunately, this character is NOT matched by ' ' (space) or '\s' (whitespace) in PCRE (preg_*() functions).
Put the following into the HTML editor on a post with uploaded images.
[gallery orderby= "RAND()"]
Save the post, then preview. Multiple refreshes should shuffle the images around randomly, because you're ordering by RAND().
Now switch to the visual editor, and insert the same thing, with all the superfluous spaces, and save. Preview the post -- you won't get random images, because the funky TinyMCE pseudo-space characters prevent the regex from parsing the attributes of your shortcode.
Proposed solution: turn off TinyMCE's whitespace preservation code when within square brackets.
Change History (22)
comment:16 nacin — 20 months ago
- Milestone changed from 2.9 to Awaiting Review
- Resolution fixed deleted
- Status changed from closed to reopened