Shortcode parsed incorrectly because of heredoc

I have a post with something like this:

[code] $foo = <<<EOT   .... EOT; [/code] 

It gets converted to this by do_shortcodes_in_html_tags():

[code] $foo = <<<EOT   .... EOT; [/code&#q3; 

Therefore, the shortcode doesn't run. Is there a way to make this shortcode work correctly?

Replay

A workaround might be:

[code]
$foo = &lt;&lt;&lt;EOT
  ....
EOT;
[/code]

where we change <<< to &lt;&lt;&lt;. We could do this automatically before do_shortcode filters the content and then replace it again afterwards.

I tested this version:

[code]
$foo = <<<EOT
....
EOT;<!---->
[/code]

and it seems to parse the shortocde's content correctly. But then we would need to remove the extra <!----> part, after do_shortcode has filtered the content.

Category: shortcode Time: 2016-07-30 Views: 0
Tags: shortcode

Related post

iOS development

Android development

Python development

JAVA development

Development language

PHP development

Ruby development

search

Front-end development

Database

development tools

Open Platform

Javascript development

.NET development

cloud computing

server

Copyright (C) avrocks.com, All Rights Reserved.

processed in 0.103 (s). 12 q(s)