[wp-trac] [WordPress Trac] #6562: Visual Editor preserves multiple
sequential spaces, fouls up shortcode parsing
WordPress Trac
wp-trac at lists.automattic.com
Thu Apr 3 02:54:38 GMT 2008
#6562: Visual Editor preserves multiple sequential spaces, fouls up shortcode
parsing
----------------------------+-----------------------------------------------
Reporter: markjaquith | Owner: anonymous
Type: defect | Status: new
Priority: normal | Milestone: 2.6
Component: Administration | Version: 2.5
Severity: normal | Keywords:
----------------------------+-----------------------------------------------
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).
Example:
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.
--
Ticket URL: <http://trac.wordpress.org/ticket/6562>
WordPress Trac <http://trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list