mirror of
https://github.com/discourse/discourse.git
synced 2025-09-07 12:02:53 +08:00
FIX: inline [code] not handled properly
The text a [code]test[/code] Would eat up the `test` text cause translation from inline to block for replace rule was not properly handled
This commit is contained in:
parent
c7a0ced656
commit
a0cd54750c
2 changed files with 16 additions and 1 deletions
|
@ -242,7 +242,14 @@ function applyBBCode(state, startLine, endLine, silent, md) {
|
|||
state.lineMax = nextLine;
|
||||
|
||||
if (rule.replace) {
|
||||
let content = state.src.slice(state.bMarks[startLine+1], state.eMarks[nextLine-1]);
|
||||
let content;
|
||||
|
||||
if (startLine === nextLine) {
|
||||
content = state.src.slice(start + info.length, closeTag.start);
|
||||
} else {
|
||||
content = state.src.slice(state.bMarks[startLine+1], state.eMarks[nextLine-1]);
|
||||
}
|
||||
|
||||
if (!rule.replace.call(this, state, info, content)) {
|
||||
return false;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue