Variables content cannot contain quotation marks
-
When I use a shortcode with a variable, and the variable value contain quotation marks, the variable is ignored — i.e., nothing appears on the page.
Here are some tests I have made.
1. Variable value containing plain text and quotation marks
Example:[shortcode variable="I am "testing" quotation marks"]
Result: Variable is ignored; nothing appears on the page.2. Variable value containing plain text and HTML code for quotation marks
Example 1:[shortcode variable="I am "testing" quotation marks"]
Example 2:[shortcode variable="I am &34;testing&34; quotation marks"]
Result: Variable works; page showsI am "testing" quotation marks
3. Variable value containing HTML tag and attribute value between quotation marks
Example:[shortcode variable="<span class="test">I am testing quotation marks</span>"]
Result: Variable is ignored; nothing appears on the page.4. Variable value containing HTML tag and attribute value with HTML code for quotation marks
Example:[shortcode variable="<span class="test">I am testing quotation marks</span>"]
Example:[shortcode variable="<span class=&34;test&34;>I am testing quotation marks</span>"]
Result: Variable works incorrectly; in the example case, the class name itself gets quotation marks, so the text appears on the page without the style for the class namedtest
. The source code will show the HTML codes ("
and&34;
) as part of the class name, exactly as wrote in the shortcode; the element inspector will show<span class=""test"">I am testing quotation marks</span>
(note the four quotation marks afterclass=
).5. Variable value containing HTML tag and attribute value without quotation marks
Example:[shortcode variable="<span class=test>I am testing quotation marks</span>"]
Result: Variable works; page showsI am testing quotation marks
with the correct style for the class namedtest
.Would it be possible to update the plugin in order to get the quotation marks working properly?
Thanks in advance.
- The topic ‘Variables content cannot contain quotation marks’ is closed to new replies.