Ox.parseMarkdown: in code spans or block, encode '>'
This commit is contained in:
parent
2482cec170
commit
bd5a4b6318
1 changed files with 3 additions and 2 deletions
|
@ -389,14 +389,15 @@
|
||||||
function(match, classname, code) {
|
function(match, classname, code) {
|
||||||
return '<pre><code'
|
return '<pre><code'
|
||||||
+ (classname ? ' class="' + classname + '"' : '')
|
+ (classname ? ' class="' + classname + '"' : '')
|
||||||
+ '>' + code + '\n</code></pre>';
|
+ '>' + code.trim().replace(/</g, '<')
|
||||||
|
+ '\n</code></pre>';
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
.replace(
|
.replace(
|
||||||
/(^|[^\\])(`+)([^\r]*?[^`])\2(?!`)/gm,
|
/(^|[^\\])(`+)([^\r]*?[^`])\2(?!`)/gm,
|
||||||
function(match, prev, backticks, code, next) {
|
function(match, prev, backticks, code, next) {
|
||||||
return prev + '<code>'
|
return prev + '<code>'
|
||||||
+ Ox.encodeHTMLEntities(code.trim()) + '</code>';
|
+ code.trim().replace(/</g, '<') + '</code>';
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
.replace(
|
.replace(
|
||||||
|
|
Loading…
Reference in a new issue