Permalink
Browse files

Escape code in client variant; no-render -> no-hl

  • Loading branch information...
1 parent 29e56ff commit 717adfd724620de73bcc44d757b991ada626ff08 @arikon arikon committed Oct 11, 2012
@@ -1,24 +1,25 @@
-var U = require('./util');
+var HLU = require('./util'),
+ U = require('../../utils');
exports.astToBemjson = function(c, p) {
- var lang = U.translateAlias(p);
+ var lang = HLU.translateAlias(p);
return {
block: 'highlight',
mods: {'render': 'client'},
lang: lang,
- content: c
+ content: U.htmlEscape(c)
};
};
exports.astToHtml = function(c, p) {
- var lang = U.translateAlias(p);
+ var lang = HLU.translateAlias(p);
return '<pre class="highlight highlight_render_client"><code class="highlight__code ' + lang + '">' +
- c +
+ U.htmlEscape(c) +
'</code></pre>';
};
@@ -1,4 +1,4 @@
-var HL_DEFAULT = 'no-render',
+var HL_DEFAULT = 'no-hl',
HL = process.env.SHMAKOWIKI_HL || HL_DEFAULT;
if (!~['server', 'client', 'ohl', 'no-render'].indexOf(HL)) {
@@ -21,7 +21,7 @@ switch (HL) {
break;
case 'no-render':
- ext = require('./no-render');
+ ext = require('./no-hl');
break;
}
File renamed without changes.

0 comments on commit 717adfd

Please sign in to comment.