WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Attributes of pre tag will be cleared when publish/update (4 posts)

  1. radarnyan
    Member
    Posted 1 year ago #

    This only happens when you are admin of a site of a Network.
    I mean, if you are the super admin of a Network, this won't affect you.

    I've no idea if this only affect <pre> tag or more.

    This BUG causing Crayon Syntax Highlighter output a mass.
    (screenshot)
    (not only for the HTML entities, all settings for this code block is lost.)

    It should be <pre class="lang:xhtml decode:true">
    I can see the attributes(class="lang:xhtml decode:true") in HTML editor.
    But as soon as I click on publish/update button,
    they just gone.(only <pre> left)

    I've tried enable/disable Crayon Syntax Highlighter for the whole Network,
    disable for the whole Network but enable for one site, the bug still exist.

  2. Ugh. That sucks!

    Without digging into it, I think they're relying on unfiltered html (something we DO NOT RECOMMEND EVER on Multisite)... Basically non-super-admins on Multisite aren't trusted and can't use special tags :/

    http://wordpress.org/extend/plugins/syntaxhighlighter/ works on Multisite, but uses shortcodes.

  3. radarnyan
    Member
    Posted 1 year ago #

    Thanks for your reply Ipstenu.

    I've searched for nfiltered MU Plugin and its description said:

    Warning! This is a very dangerous plugin to activate if you have untrusted users on your site. Any user could add Javascript code to steal the login cookies of any visitor who runs a blog on the same site. The rogue user can then inpersonate any of those users and wreak havoc.

    ._. Then I decided to use shortcodes instead.
    I only open new sites for friends but most of them are better progremmer than me and sometimes they like to prank x_x.

    Crayon Syntax Highlighter do support shortcodes.

    For example, I can use [html mark="1,16" decode="true"] instead of using <pre class="lang:xhtml decode:true">

    I'll find a way to modify the Crayon button on editor to see if it's possible to use short codes by default instead of using <pre> tag.

    Maybe come back to update later :)

  4. radarnyan
    Member
    Posted 1 year ago #

    Since shortcodes are not easy to edit and not friendly enough,
    Just found out a way to allow the tags we want manually.

    It's much more safer than enable Unfiltered MU plugin
    (However, I lost the heading U at the earlier post and not able to edit it now ;w;)

    wp-includes/kses.php (start from 299 line)

    'pre' => array(
    			'style' => true,
    			'width' => true,
    			'class' => true,		// Allow Crayon Attributes
    			'title' => true,		// Allow Crayon Titles
    		),

Topic Closed

This topic has been closed to new replies.

About this Topic