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 = $('') .addClass('OxComment OxSerif') - .html(quote(trim(section.comment))) + .html(Ox.addLinks(section.comment, true)) .appendTo($section), $code = $('') .addClass('OxCode') @@ -74,8 +74,10 @@ Ox.SourceViewer = function(options, self) { }); }); - function quote(str) { - return str.replace(/\s`(.*?)`/g, ' $1') + function expand(str) { + return str.replace(/(\W)`([\s\S]+?)`/g, function(match, outer, inner) { + return outer + '' + Ox.encodeHTMLEntities(inner) + ''; + }) } function trim(str) {