Fix markdown preview $$ support (#31514)
close #31481 currently `$$A + B$$ test` will ignore text after $$ block test text  before fix  after fix  github display  (cherry picked from commit f0033051d5ce07f5a18d2aacef6bfdca5fc69014)
This commit is contained in:
parent
e1b90212e4
commit
f92591b825
6 changed files with 79 additions and 6 deletions
|
@ -47,6 +47,12 @@ func (b *blockParser) Open(parent ast.Node, reader text.Reader, pc parser.Contex
|
|||
}
|
||||
idx := bytes.Index(line[pos+2:], endBytes)
|
||||
if idx >= 0 {
|
||||
// for case $$ ... $$ any other text
|
||||
for i := pos + idx + 4; i < len(line); i++ {
|
||||
if line[i] != ' ' && line[i] != '\n' {
|
||||
return nil, parser.NoChildren
|
||||
}
|
||||
}
|
||||
segment.Stop = segment.Start + idx + 2
|
||||
reader.Advance(segment.Len() - 1)
|
||||
segment.Start += 2
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue