allow templates and macros to include blanks in path (#191)

This commit is contained in:
Stephan Hradek 2022-06-06 08:35:48 +02:00 committed by GitHub
parent 5428cc6833
commit 3c7bd6133f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View File

@ -18,7 +18,7 @@ import (
// <!-- Include: <template path>
// <optional yaml data> -->
var reIncludeDirective = regexp.MustCompile(
`(?s)<!--\s*Include:\s*(?P<template>\S+)\s*(\n(?P<config>.*?))?-->`)
`(?s)<!--\s*Include:\s*(?P<template>.+?)\s*(\n(?P<config>.*?))?-->`)
func LoadTemplate(
base string,

View File

@ -21,7 +21,7 @@ var reMacroDirective = regexp.MustCompile(
`(?s)` + // dot capture newlines
/**/ `<!--\s*Macro:\s*(?P<expr>[^\n]+)\n` +
/* */ `\s*Template:\s*(?P<template>\S+)\s*` +
/* */ `\s*Template:\s*(?P<template>.+?)\s*` +
/* */ `(?P<config>\n.*?)?-->`,
)