Support Forum

Syntax Highlighter is failing to highlight php properly

RI rickandersonaia
rickandersonaia
Member

This is a newish issue – that showed up after a recent upgrade.

It seems to highlight CSS just fine – an example from today – http://www.byobwebsite.com/forum/general-thesis-questions/footer-doesnt-sit-at-bottom-of-page/#p25651

But fails entirely with PHP – an other example from today – http://www.byobwebsite.com/forum/general-genesis-questions/problems-showing-correct-image-size-for-portfolio-entries-on-enterprise-pro-homepage/#p25653

I have tried deleting it and redoing it several times, including inserting the code into a blank post, but nothing seems to work.

16 Answers

New Answer

YS Yellow Swordfish
Yellow Swordfish
Member

We use the highlighter regularly here with php and with no issue showing up. How did you actually do that on the post link you gave? I don’t see any of the normal syntax highlighter html…

RI rickandersonaia
rickandersonaia
Member

I select the text – click the highlighter and choose php.

Generally the text is cut directly from NetBeans, although I did try pasting it into notepad first to see if it helped.

MP Mr Papa
Mr Papa
Member

Upgrade of what? Are you using latest SP and latest tinymce and syntax highlighting plugin?

Any other plugins that format page content? Does your theme or other plugin  add any buttons to wp editor? The fact much or all of our inserted html and css are getting stripped is suspicious…

As Andy said, this plugin is very popular with no other reported  issues and we use it almost daily here…. Not saying you are not having an issue, but it’s not a systemic one so need to identify what is going on locally for you..

RI rickandersonaia
rickandersonaia
Member

Yeah, I’m sorry – upgrade of SP and all of the related plugins.  

No, I don’t use any TinyMCE editor related plugins – A couple of plugins do add buttons to the post editor – but not the forum editor.

I’ll troubleshoot this further by deactivating all other plugins to see what happens and post the results back here.

YS Yellow Swordfish
Yellow Swordfish
Member

Please do check these. We have encountered several plugins that add items to the tinyMCE editor (i.e., for the blog post creation side) where the authors have not taken into consideration the editor can also be used on the front-end and their code has caused problems with the editor’s use within Simple:Press. They often seem to hook it into the WP ‘init’ hook where it should be the ‘admin_init’ hook for example.

Also feel free to paste some code here and try the highlighter as a test run.

RI rickandersonaia
rickandersonaia
Member

This appears to have something to do with pasting.  For example the code below doesn’t get the pre sf-brush tag added to it when I paste.  Although if I type it directly it works just fine.

/*******************************************************************
* Wishlist Member Login Widget
********************************************************************/
.WishListMember_Widget .widget-title {
margin: 0 0 15px 0;
}

.custom #wlmember_loginwidget label input
{
margin-bottom:5px;
}
.custom #wlmember_loginwidget input[type=submit] {
color: #fff;
background: #0e426c;
border-left: 1px solid #7ab7e8;
border-top: 1px solid #7ab7e8;
border-right: 1px solid #084577;
border-bottom: 1px solid #084577;
-moz-border-radius: 3px;
-khtml-border-radius: 3px;
-webkit-border-radius: 3px;
border-radius: 3px;
height:25px;
width:100px;
cursor:pointer;

}
.custom #wlmember_loginwidget input[type=submit]:hover {
border: 1px solid #555;
background: #7f7e7d;
}

RI rickandersonaia
rickandersonaia
Member

Actually it didn’t work on yours either!

RI rickandersonaia
rickandersonaia
Member

Here’s a test to go along with the video

/*******************************************************************
* Wishlist Member Login Widget
********************************************************************/
.WishListMember_Widget .widget-title {
margin: 0 0 15px 0;
}

.custom #wlmember_loginwidget label input
{
margin-bottom:5px;
}
.custom #wlmember_loginwidget input[type=submit] {
color: #fff;
background: #0e426c;
border-left: 1px solid #7ab7e8;
border-top: 1px solid #7ab7e8;
border-right: 1px solid #084577;
border-bottom: 1px solid #084577;
-moz-border-radius: 3px;
-khtml-border-radius: 3px;
-webkit-border-radius: 3px;
border-radius: 3px;
height:25px;
width:100px;
cursor:pointer;

}
.custom #wlmember_loginwidget input[type=submit]:hover {
border: 1px solid #555;
background: #7f7e7d;
}

MP Mr Papa
Mr Papa
Member

code test…

 /*******************************************************************
* Wishlist Member Login Widget
********************************************************************/
.WishListMember_Widget .widget-title {
margin: 0 0 15px 0;
}

.custom #wlmember_loginwidget label input
{
margin-bottom:5px;
}
.custom #wlmember_loginwidget input[type=submit] {
color: #fff;
background: #0e426c;
border-left: 1px solid #7ab7e8;
border-top: 1px solid #7ab7e8;
border-right: 1px solid #084577;
border-bottom: 1px solid #084577;
-moz-border-radius: 3px;
-khtml-border-radius: 3px;
-webkit-border-radius: 3px;
border-radius: 3px;
height:25px;
width:100px;
cursor:pointer;

}
.custom #wlmember_loginwidget input[type=submit]:hover {
border: 1px solid #555;
background: #7f7e7d;
}

no issue pasting… it for me…  and highlighting and using our button (NOT the code button) – looks like {$}

YS Yellow Swordfish
Yellow Swordfish
Member

Once in a post and saved to the DB then it is impossible to look at the original content but I am thinking this has to have something to do with this.

I know you said you pasted it into notepad to check it pasted OK. But did you then reselect from notepad and copy it from there? I am suspicious that what you are getting from your source – NetBeans maybe – has other stuff under the wraps. 

RI rickandersonaia
rickandersonaia
Member

Actually, it appears as if I have other javascript errors as well.  I am posting this in IE – but on my own site, with no plugins active and using TwentyTwelve I can’t get IE to post a new topic or even navigate around the site.

I discovered this because I wondered if my pasting issue was related to the browser I typically use – Chrome.  So I switched to IE only to discover that nothing on the forum works properly when using IE10 – in any of it’s modes.

One of the symptoms of this is that the tooltips cover the actual button on hover.  Which it doesn’t do here.

RI rickandersonaia
rickandersonaia
Member

OK – the fix for the IE issue was the define tooltips in the theme file.  Once that was done, IE works fine and pasting from NotePad to the forum in IE ended up with the same result as Chrome.