blog.humaneguitarist.org

syntax highlighting on WordPress: you can quote me on this

[Sat, 14 Jan 2012 16:46:32 +0000]
I've totally over-blogged this month, but just as a note to self ... I've noticed that when using a syntax highlighter with WordPress - I'm using Syntax Highlighter Compress [http://wordpress.org/extend/plugins/syntax-highlighter-compress/] - that using single quotes can sometimes cause the highlighting to break down. In the example below I have identical code written twice. Well, almost identical. In the first, I'm surrounding "data-startTime" with single quotes and in the second I'm using doubles. The first has some highlighting problems where single quotes are. Oh well, I guess I'll just have to keep an eye on that. function jAUs_3(this_currentTime,thisAudioTag_stopTime,i){ if (thisAudioTag_stopTime){ //if there's a data-stopTime attribute then ... if (this_currentTime > thisAudioTag_stopTime){ //... reset audio to data-startTime when data-stopTime is reached. audioTagArray[i].currentTime = audioTagArray[i].getAttribute('data-startTime'); audioTagArray[i].pause(); } } else if (audioTagArray[i].ended == true){ //if there's no data-stopTime, move back to data-startTime when playback has ended. audioTagArray[i].currentTime = audioTagArray[i].getAttribute('data-startTime'); audioTagArray[i].pause(); } } function jAUs_3(this_currentTime,thisAudioTag_stopTime,i){ if (thisAudioTag_stopTime){ //if there's a data-stopTime attribute then ... if (this_currentTime > thisAudioTag_stopTime){ //... reset audio to data-startTime when data-stopTime is reached. audioTagArray[i].currentTime = audioTagArray[i].getAttribute("data-startTime"); audioTagArray[i].pause(); } } else if (audioTagArray[i].ended == true){ //if there's no data-stopTime, move back to data-startTime when playback has ended. audioTagArray[i].currentTime = audioTagArray[i].getAttribute("data-startTime"); audioTagArray[i].pause(); } }