Skip to content

Commit

Permalink
Add missing subtype so W3C validator will be happy 2
Browse files Browse the repository at this point in the history
Both "text/syntaxhighlighter" for "syntaxhighlighter" for backwardscompatible reasons.
  • Loading branch information
scootergrisen committed May 31, 2013
1 parent 3e725f9 commit fac4810
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions demos/big_file.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ <h1>SyntaxHighlighter Large File Demo</h1>
This demo shows the speed of SyntaxHighlighter and ability to render large files.
</p>

<script type="syntaxhighlighter" class="brush: js;"><![CDATA[
<script type="text/syntaxhighlighter" class="brush: js;"><![CDATA[
//
// Begin anonymous function. This is used to contain local scope variables without polutting global scope.
//
Expand Down Expand Up @@ -265,7 +265,7 @@ <h1>SyntaxHighlighter Large File Demo</h1>
result = []
;

// support for &lt;SCRIPT TYPE="syntaxhighlighter" /> feature
// support for &lt;SCRIPT TYPE="text/syntaxhighlighter" /> feature
if (conf.useScriptTags)
elements = elements.concat(getSyntaxHighlighterScriptTags());

Expand Down Expand Up @@ -1057,7 +1057,9 @@ <h1>SyntaxHighlighter Large File Demo</h1>
};

/**
* Finds all &lt;SCRIPT TYPE="syntaxhighlighter" /> elementss.
* Finds all &lt;SCRIPT TYPE="text/syntaxhighlighter" /> elementss.
* Finds both "text/syntaxhighlighter" and "syntaxhighlighter"
* ...in order to make W3C validator happy with subtype and backwardscompatible without subtype
* @return {Array} Returns array of all found SyntaxHighlighter tags.
*/
function getSyntaxHighlighterScriptTags()
Expand All @@ -1067,7 +1069,7 @@ <h1>SyntaxHighlighter Large File Demo</h1>
;

for (var i = 0; i < tags.length; i++)
if (tags[i].type == 'syntaxhighlighter')
if (tags[i].type == 'text/syntaxhighlighter' || tags[i].type == 'syntaxhighlighter')
result.push(tags[i]);

return result;
Expand Down

0 comments on commit fac4810

Please sign in to comment.