Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Line break if used tag inside echo #2

Closed
ankitpokhrel opened this Issue Nov 4, 2013 · 3 comments

Comments

Projects
None yet
2 participants

Hi,

Everything is working well but if i try to echo a tag, the plugin is using line break for those tag.

EG:

echo "some string"; // Works perfect!

echo "</div>"; // If a tag is used inside echo

//outputs by breaking the line
echo "
</div>
";

Am i missing anything?

Thanks,
Ankit

Owner

AndiDittrich commented Nov 8, 2013

thank's for your report. this is a damn bug caused by wordpress' content preformating...the content within the shortcode got changed before processed by the plugin.
this will also cause this issue: http://wordpress.org/support/topic/code-indent-remove-by-wordpress-editor

i will try to fix it by using an own shortcode handler, which will executed before wordpress' filters..

update: this problem here is caused by the wpautop filter, the following code will fix it by changing the execution order of the filters (shortcodes are handled with priority 10):

remove_filter( 'the_content', 'wpautop' );
add_filter( 'the_content', 'wpautop' , 12);

as a hotfix, you can add this code into your theme's functions.php file. this code will be included into the next release

@AndiDittrich AndiDittrich reopened this Nov 9, 2013

Owner

AndiDittrich commented Nov 9, 2013

update2: the problem only occurs when using the text editor - the TinyMCE will replace the <> brackets with &lt; and &gt; and the code doesn't got modified by wpautop
i've added the code above to the next release. this will definitely fix this issue :)

Thank you for the quick fix. That solved the issue ;)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment