mirror of https://github.com/svaarala/duktape.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
12 lines
388 B
12 lines
388 B
// process.js
|
|
function processLine(line) {
|
|
return line.trim()
|
|
.replace(/[<>&"'\u0000-\u001F\u007E-\uFFFF]/g, function(x) {
|
|
// escape HTML characters
|
|
return '&#' + x.charCodeAt(0) + ';'
|
|
})
|
|
.replace(/\*(.*?)\*/g, function(x, m) {
|
|
// automatically bold text between stars
|
|
return '<b>' + m + '</b>';
|
|
});
|
|
}
|
|
|