Opened 11 years ago
Closed 11 years ago
#27185 closed defect (bug) (fixed)
[[gallery]] not supported by editor
Reported by: | wpweaver | Owned by: | |
---|---|---|---|
Milestone: | 3.9 | Priority: | normal |
Severity: | normal | Version: | 3.8.1 |
Component: | TinyMCE | Keywords: | has-patch |
Focuses: | javascript, administration | Cc: |
Description (last modified by )
Unlike other shortcode descriptions included in a page/post using the [[shortcode]]
double [[ ... ]]
convention to enable displaying the shortcode name in a post instead of the results, [[gallery]]
does not work. The editor insists on detecting [[gallery]]
as a reference to the gallery for the special display treatment. This makes it nearly impossible to write a post about the gallery shortcode.
I have not checked, but this may apply to other special case shortcodes (like images inserted via shortcodes from the media library), but it could be a general failure of TinyMCE to follow the [[shortcode]]
convention for shortcodes that get special treatment by the editor.
Sorry about the issues with using [[
and ]]
- I couldn't find any way to escape the square brackets correctly.
Attachments (2)
Change History (9)
#2
@
11 years ago
- Description modified (diff)
Sorry about the issues with using
[[
and]]
- I couldn't find any way to escape the square brackets correctly.
Fixed this by using the backtick `.
#3
@
11 years ago
- Keywords has-patch added
- Milestone changed from Awaiting Review to 3.9
27185.patch changes the RegEx to match an optional second opening and closing bracket. (Same as in get_shortcode_regex()). The callback checks if the match starts with [[
. If true, just return the match, otherwise call the html callback.
We probably need the same for the video and audio shortcode.
#4
@
11 years ago
27185.2.patch copies the RegEx from wp.shortcodes to getShortcodeRegex() and uses it for the gallery, video and audio shortcode.
This seems to be related to TinyMCE, as the initial save does not trigger the shortcode, but consecutive saves of the post does make the gallery trigger (And the gallery gets a gallery display in TinyMCE on post reload as well as added newlines to stop the secondary closing bracket from being inline to prevent this)