translate foo
to <code>foo</code>
This commit is contained in:
parent
ef15919a3e
commit
8c60fef203
1 changed files with 5 additions and 1 deletions
|
@ -60,7 +60,7 @@ Ox.SourceViewer = function(options, self) {
|
||||||
.appendTo(self.$table),
|
.appendTo(self.$table),
|
||||||
$comment = $('<td>')
|
$comment = $('<td>')
|
||||||
.addClass('OxComment OxSerif')
|
.addClass('OxComment OxSerif')
|
||||||
.html(trim(section.comment))
|
.html(quote(trim(section.comment)))
|
||||||
.appendTo($section),
|
.appendTo($section),
|
||||||
$code = $('<td>')
|
$code = $('<td>')
|
||||||
.addClass('OxCode')
|
.addClass('OxCode')
|
||||||
|
@ -74,6 +74,10 @@ Ox.SourceViewer = function(options, self) {
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
function quote(str) {
|
||||||
|
return str.replace(/\s`(.*?)`/g, ' <code>$1</code>')
|
||||||
|
}
|
||||||
|
|
||||||
function trim(str) {
|
function trim(str) {
|
||||||
// removes leading or trailing empty line
|
// removes leading or trailing empty line
|
||||||
return str.replace(/^\s*\n/, '').replace(/\n\s*$/, '');
|
return str.replace(/^\s*\n/, '').replace(/\n\s*$/, '');
|
||||||
|
|
Loading…
Reference in a new issue