diff --git a/source/Ox.UI/js/Code/SourceViewer.js b/source/Ox.UI/js/Code/SourceViewer.js index dc499717..0a92d591 100644 --- a/source/Ox.UI/js/Code/SourceViewer.js +++ b/source/Ox.UI/js/Code/SourceViewer.js @@ -45,7 +45,7 @@ Ox.SourceViewer = function(options, self) { if (!/^\/\//.test(token.value)) { if (type == 'comment') { i && sections.push({comment: '', code: ''}); - token.value = token.value.slice(2, -2); + token.value = expand(trim(token.value.slice(2, -2))); self.options.replaceComment.forEach(function(replace) { token.value = token.value.replace( replace[0], replace[1] @@ -60,7 +60,7 @@ Ox.SourceViewer = function(options, self) { .appendTo(self.$table), $comment = $('
$1
')
+ function expand(str) {
+ return str.replace(/(\W)`([\s\S]+?)`/g, function(match, outer, inner) {
+ return outer + '' + Ox.encodeHTMLEntities(inner) + '
';
+ })
}
function trim(str) {