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) {
|
||||
return '<pre><code'
|
||||
+ (classname ? ' class="' + classname + '"' : '')
|
||||
+ '>' + code + '\n</code></pre>';
|
||||
+ '>' + code.trim().replace(/</g, '<')
|
||||
+ '\n</code></pre>';
|
||||
}
|
||||
)
|
||||
.replace(
|
||||
/(^|[^\\])(`+)([^\r]*?[^`])\2(?!`)/gm,
|
||||
function(match, prev, backticks, code, next) {
|
||||
return prev + '<code>'
|
||||
+ Ox.encodeHTMLEntities(code.trim()) + '</code>';
|
||||
+ code.trim().replace(/</g, '<') + '</code>';
|
||||
}
|
||||
)
|
||||
.replace(
|
||||
|
|
Loading…
Reference in a new issue