We have a shortcode that needs to support brackets appearing in one of its attributes. The use case is for a pull quote with words in the quote paraphrased with brackets.
As mentioned in this Trac ticket from 10 years ago, brackets can be escaped by using double brackets [[ and ]]. This works in text mode of the editor, but upon switching to visual mode the shortcode terminates prematurely at the first appearance of ].
For example:
// Desired markup
[pullquote content="This is another way to integrate [the public library] into people's lives" align="right" credit="Community Health Librarian" /]
// Escaping markup
[pullquote content="This is another way to integrate [[the public library]] into people's lives" align="right" credit="Community Health Librarian" /]
// Resulting markup
[pullquote content="This is another way to integrate [[the public library]
] into people's lives" align="right" credit="Community Health Librarian" /]
We are using Shortcake Bakery to register this shortcode so it's possible the issue lies with that plugin and not this one.
We have a shortcode that needs to support brackets appearing in one of its attributes. The use case is for a pull quote with words in the quote paraphrased with brackets.
As mentioned in this Trac ticket from 10 years ago, brackets can be escaped by using double brackets
[[
and]]
. This works in text mode of the editor, but upon switching to visual mode the shortcode terminates prematurely at the first appearance of]
.For example:
We are using Shortcake Bakery to register this shortcode so it's possible the issue lies with that plugin and not this one.