Slightly off-topic, but Haluk - what are you trying to do with structured
Simply because if you find a different way to store and access this data.
Post by Haluk KarameteOtto,
I've found a solution to the issue. ( I tested and saw it works )
I simply switched point of views: Instead of protecting the structured data
within the <code></code> area ( which is problematic as my prev message
pointed out) and make that section immune to the wptexturize, I went the
other way. I made the entire shortcode to be exempt from the wptexturize
and mark the content-content section using a non-HTML delim (that the
visual tab editor cannot do anything about ) and apply the wptexturize
myself in the back end.
The simple steps are as follows;
step 1
use the no_texturize_shortcodes filter and made the shortcode to be exempt.
step 2
simply wrap the content area in my shortcode that I want to be processed by
wptexturize in {content}{content} delims.
step 3
in the back end, when processing the $content in my shortcode function,
simply do
$content = wptexturize($content);
- to apply the wptexturize magic over that section
This gives me piece of mind that the section that is not wrapped in
{content}{content} blocks are not processed by the wptexturize - thanks to
the step 1.
This approach has solved my problem.
Now I will see what I can do to do for the little brother of wptexturize
which is wpautop. :)
Post by Haluk KarameteOtto,
The wp_texturize has a great functionality; If you use the HTML tag
<code>
Post by Haluk Karamete& </code> in your shortcode content area, it leaves that section
untouched.
Post by Haluk KarameteThis 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.
But...
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
Post by Haluk Karametethe user's end?
I thought of tapping into the no_texturize_shortcodes filter - as
expained
http://codex.wordpress.org/Plugin_API/Filter_Reference/no_texturize_shortcodes),
as a different way to tackle the whole thing...
Post by Haluk KarameteBut 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
Post by Haluk Karameteseparate 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
Post by Haluk Karametealone..
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
Post by Haluk Karametemove 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?
Post by OttoThat would be the wptexturize function.
http://codex.wordpress.org/Function_Reference/wptexturize
-Otto
On Mon, May 26, 2014 at 7:31 PM, Haluk Karamete <
Post by Haluk KarameteThis is a trickty one...
When I type in ' ( which is a simple single quote) in the content area
in
Post by Haluk Karametemy shortcode, I see that it ends up as a 'right single quotation mark'
that
Post by Haluk Karameteis ’
That's observation #1.
It gets even more interesting, but when I put two of them, one after
the
Post by Haluk KarametePost by OttoPost by Haluk Karameteother like this, ( '' ) , I ended up with ” ( instead of
’’).
This is very confusing to me cause I'm middle of parsing my structured
data
Post by Haluk Karametebased 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
Post by Haluk Karametethe 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
http://lists.automattic.com/mailman/listinfo/wp-hackers
_______________________________________________
wp-hackers mailing list
http://lists.automattic.com/mailman/listinfo/wp-hackers
_______________________________________________
wp-hackers mailing list
http://lists.automattic.com/mailman/listinfo/wp-hackers