From 8c60fef203479fdabce3097f092150269814bea4 Mon Sep 17 00:00:00 2001 From: rolux Date: Mon, 28 May 2012 15:58:10 +0200 Subject: [PATCH] translate `foo` to foo --- source/Ox.UI/js/Code/Ox.SourceViewer.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/source/Ox.UI/js/Code/Ox.SourceViewer.js b/source/Ox.UI/js/Code/Ox.SourceViewer.js index e7acf5ad..dc499717 100644 --- a/source/Ox.UI/js/Code/Ox.SourceViewer.js +++ b/source/Ox.UI/js/Code/Ox.SourceViewer.js @@ -60,7 +60,7 @@ Ox.SourceViewer = function(options, self) { .appendTo(self.$table), $comment = $('') .addClass('OxComment OxSerif') - .html(trim(section.comment)) + .html(quote(trim(section.comment))) .appendTo($section), $code = $('') .addClass('OxCode') @@ -74,6 +74,10 @@ Ox.SourceViewer = function(options, self) { }); }); + function quote(str) { + return str.replace(/\s`(.*?)`/g, ' $1') + } + function trim(str) { // removes leading or trailing empty line return str.replace(/^\s*\n/, '').replace(/\n\s*$/, '');