[wp-hackers] single quote in content ends up as Unicode Character 'RIGHT SINGLE QUOTATION MARK'

Haluk Karamete halukkaramete at gmail.com
Tue May 27 10:55:38 UTC 2014


The wp_texturize has a great functionality; If you use the HTML tag <code>
& </code> in your shortcode content area, it leaves that section untouched.
This way you can create sections within your shortcode as to which area
wp_texturize to operate on or off.

So for all the special symbols used within the <code> & </code> block,
(such as the single quote <code>'</code>), I get them as is. For example,
for the ', I get it as '. I do not get the ’ anymore. The <code>
feature simply takes care of the problem - in a brilliant way.


If when you switch the post editor's Tiny MCI's visual tab, that simple &
innocent action ( which is irreversible ) removes the <code> and </code>
tags permanently and replaces them with  ! Then all bets are off.

Is it possible to prevent that from happening so that the structured data
area that I'm trying to protect thru the <code></code> in my shortcode is
immune to those innocent and accidental switches that may happen anytime on
the user's end?

I thought of tapping into the no_texturize_shortcodes filter - as expained
here (
as a different way to tackle the whole thing...

But I sense that that would assume the entire content area of the to be
avoided by the wp_texturize.

My shortcode has two sections... the regular content area section... and
the code section that has the code instructions ..  I'd like to be able to
separate these  two sections ( code and content ) from one another.

In other words, I'd like wp_texturize to do what's designed for on the
"content-content" area in my shortcode but leave the "content-code" section

If the <code></code> were to be preserved upon the visual-tab switch, I
would be done with this issue and programming the parser now. But I cannot
move on at this moment before I nail this issue in a future proof way.

What do you think can be done to pull this wish off?

On Mon, May 26, 2014 at 6:15 PM, Otto <otto at ottodestruct.com> wrote:

> That would be the wptexturize function.
> http://codex.wordpress.org/Function_Reference/wptexturize
> -Otto
> On Mon, May 26, 2014 at 7:31 PM, Haluk Karamete <halukkaramete at gmail.com
> >wrote:
> > This is a trickty one...
> >
> > When I type in ' ( which is a simple single quote) in the content area in
> > my shortcode, I see that it ends up as a 'right single quotation mark'
> that
> > is ’
> >
> > That's observation #1.
> >
> > It gets even more interesting, but when I put two of them, one after the
> > other  like this, ( '' ) , I ended up with ”  ( instead of
> > ’’).
> >
> > This is very confusing to me cause I'm middle of parsing my structured
> data
> > based shortcode. The content area interferes with me big time.
> >
> > Could you tell me which WordPress function(s) involve here so that a
> > simple good old (') single quote ends up with ’? Could you point me
> > the location where this is happening?
> >
> > With that location, I'm hoping to see the complete view of what other
> > conversion are happening that my parser be aware of.
> >
> > Thank you
> > _______________________________________________
> > wp-hackers mailing list
> > wp-hackers at lists.automattic.com
> > http://lists.automattic.com/mailman/listinfo/wp-hackers
> >
> _______________________________________________
> wp-hackers mailing list
> wp-hackers at lists.automattic.com
> http://lists.automattic.com/mailman/listinfo/wp-hackers

More information about the wp-hackers mailing list