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),
|
||||
$comment = $('<td>')
|
||||
.addClass('OxComment OxSerif')
|
||||
.html(trim(section.comment))
|
||||
.html(quote(trim(section.comment)))
|
||||
.appendTo($section),
|
||||
$code = $('<td>')
|
||||
.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) {
|
||||
// removes leading or trailing empty line
|
||||
return str.replace(/^\s*\n/, '').replace(/\n\s*$/, '');
|
||||
|
|
Loading…
Reference in a new issue