Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Line break if used tag inside echo #2

Closed
ankitpokhrel opened this Issue · 3 comments

2 participants

@ankitpokhrel

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

@AndiDittrich
Owner

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
@AndiDittrich
Owner

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 :)

@ankitpokhrel

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
Something went wrong with that request. Please try again.