Improve shortcode indentation handling

* Record the leading whitespace (tabs, spaces) before the shortcode when parsing the page.
* Apply that indentation to the rendered result of shortcodes without inner content (where the user will apply indentation).

Fixes #9946
This commit is contained in:
Bjørn Erik Pedersen 2022-05-28 13:18:50 +02:00
parent 322d19a81f
commit d2cfaede5b
No known key found for this signature in database
GPG key ID: 330E6E2BD4859D8F
9 changed files with 208 additions and 4 deletions

View file

@ -149,6 +149,11 @@ func (t *Iterator) Backup() {
t.lastPos--
}
// Pos returns the current position in the input.
func (t *Iterator) Pos() int {
return t.lastPos
}
// check for non-error and non-EOF types coming next
func (t *Iterator) IsValueNext() bool {
i := t.Peek()