Fix indentation in highlight shortcode

This commit adds a new `.InnerDeindent` method to the shortcode context, which is `.Inner` with any
indendation removed. This is then used in the built-in `highlight` shortcode to prevent the extra
whitespace getting hightlighted.

Fixes #4717
This commit is contained in:
Bjørn Erik Pedersen
2022-05-30 20:42:46 +02:00
parent 9e904d756b
commit 6f7bf3f2d7
5 changed files with 78 additions and 3 deletions

View File

@@ -272,7 +272,7 @@ func (c *templateContext) collectInner(n *parse.CommandNode) {
idents = nt.Ident
}
if c.hasIdent(idents, "Inner") {
if c.hasIdent(idents, "Inner") || c.hasIdent(idents, "InnerDeindent") {
c.t.parseInfo.IsInner = true
break
}