mirror of
https://github.com/kovetskiy/mark.git
synced 2025-04-23 21:32:41 +08:00
add optional spaces in regexps
This commit is contained in:
parent
de2c876632
commit
4cfda3afc1
@ -16,7 +16,9 @@ import (
|
||||
)
|
||||
|
||||
var (
|
||||
reIncludeDirective = regexp.MustCompile(`(?s)<!-- Include: (\S+)(.*?)-->`)
|
||||
reIncludeDirective = regexp.MustCompile(
|
||||
`(?s)<!--\s*Include:\s*(\S+)(.*?)-->`,
|
||||
)
|
||||
)
|
||||
|
||||
func LoadTemplate(
|
||||
|
@ -14,7 +14,7 @@ import (
|
||||
)
|
||||
|
||||
var reMacroDirective = regexp.MustCompile(
|
||||
`(?s)<!-- Macro: ([^\n]+)\n\s*Template: (\S+)\n(.*?)-->`,
|
||||
`(?s)<!--\s*Macro:\s*([^\n]+)\n\s*Template:\s*(\S+)\n(.*?)-->`,
|
||||
)
|
||||
|
||||
type Macro struct {
|
||||
|
Loading…
x
Reference in New Issue
Block a user