mirror of
https://github.com/go-gitea/gitea
synced 2025-07-06 02:27:20 +00:00
Fix markdown preview $$ support (#31514)
close #31481 currently `$$A + B$$ test` will ignore text after $$ block test text  before fix  after fix  github display 
This commit is contained in:
@ -53,6 +53,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
|
||||
|
Reference in New Issue
Block a user