diff options
author | Matthew Holt <mholt@users.noreply.github.com> | 2020-07-08 16:46:56 -0600 |
---|---|---|
committer | Matthew Holt <mholt@users.noreply.github.com> | 2020-07-08 16:46:56 -0600 |
commit | a2dae1d43fcfb08a4b748302502874234d7d64af (patch) | |
tree | 34ef623e775484e0bd8fe7946d25e6cf795d8afa /modules/caddyhttp/templates/tplcontext_test.go | |
parent | efc0cc5e8557ebc54dd30931a27767139e808c80 (diff) |
templates: Fix front matter closing fence search
This makes it choose first matching closing fence instead of last one,
which could appear in document body.
Diffstat (limited to 'modules/caddyhttp/templates/tplcontext_test.go')
-rw-r--r-- | modules/caddyhttp/templates/tplcontext_test.go | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/modules/caddyhttp/templates/tplcontext_test.go b/modules/caddyhttp/templates/tplcontext_test.go index f90b851..32c6a16 100644 --- a/modules/caddyhttp/templates/tplcontext_test.go +++ b/modules/caddyhttp/templates/tplcontext_test.go @@ -317,6 +317,17 @@ title: Welcome body: "\n### Test", }, { + // yaml with non-fence '...' line after closing fence (i.e. first matching closing fence should be used) + input: `--- +title: Welcome +--- +### Test +... +yeah`, + expect: `Welcome`, + body: "\n### Test\n...\nyeah", + }, + { // toml input: `+++ title = "Welcome" |