parent
b32f0cdfa0
commit
3c4a06273f
5 changed files with 101 additions and 32 deletions
|
@ -79,9 +79,10 @@ func (parser *inlineParser) Parse(parent ast.Node, block text.Reader, pc parser.
|
|||
opener := len(parser.start)
|
||||
|
||||
// Now look for an ending line
|
||||
depth := 0
|
||||
ender := -1
|
||||
for i := opener; i < len(line); i++ {
|
||||
if bytes.HasPrefix(line[i:], parser.end) {
|
||||
if depth == 0 && bytes.HasPrefix(line[i:], parser.end) {
|
||||
succeedingCharacter := byte(0)
|
||||
if i+len(parser.end) < len(line) {
|
||||
succeedingCharacter = line[i+len(parser.end)]
|
||||
|
@ -99,6 +100,11 @@ func (parser *inlineParser) Parse(parent ast.Node, block text.Reader, pc parser.
|
|||
i++
|
||||
continue
|
||||
}
|
||||
if line[i] == '{' {
|
||||
depth++
|
||||
} else if line[i] == '}' {
|
||||
depth--
|
||||
}
|
||||
}
|
||||
if ender == -1 {
|
||||
return nil
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue