aboutsummaryrefslogtreecommitdiffstats
path: root/docs/src/ngdoc.js
diff options
context:
space:
mode:
authorMisko Hevery2011-04-29 14:43:43 -0700
committerIgor Minar2011-06-06 22:28:37 -0700
commitb6bc6c2ddf1ae1523ec7e4cb92db209cd6501181 (patch)
tree7c3415a03732bdfc3ac630143936b2d31df91c82 /docs/src/ngdoc.js
parentea6b87c24ba70d2554c0f9a3e80b245dc3780234 (diff)
downloadangular.js-b6bc6c2ddf1ae1523ec7e4cb92db209cd6501181.tar.bz2
fix syntax highlighting on the javascript
Diffstat (limited to 'docs/src/ngdoc.js')
-rw-r--r--docs/src/ngdoc.js7
1 files changed, 6 insertions, 1 deletions
diff --git a/docs/src/ngdoc.js b/docs/src/ngdoc.js
index 875b24df..57202809 100644
--- a/docs/src/ngdoc.js
+++ b/docs/src/ngdoc.js
@@ -70,7 +70,12 @@ Doc.prototype = {
parts.forEach(function(text, i){
if (text.match(/^<pre>/)) {
text = text.replace(/^<pre>([\s\S]*)<\/pre>/mi, function(_, content){
- return '<div ng:non-bindable><pre class="brush: js; html-script: true;">' +
+ var clazz = 'brush: js;'
+ if (content.match(/\<\w/)) {
+ // we are HTML
+ clazz += ' html-script: true;';
+ }
+ return '<div ng:non-bindable><pre class="' + clazz +'">' +
content.replace(/</g, '&lt;').replace(/>/g, '&gt;') +
'</pre></div>';
});