Skip to content

Commit

Permalink
add optional spaces in regexps
Browse files Browse the repository at this point in the history
  • Loading branch information
seletskiy committed Aug 8, 2019
1 parent de2c876 commit 4cfda3a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion pkg/mark/includes/templates.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@ import (
)

var (
reIncludeDirective = regexp.MustCompile(`(?s)<!-- Include: (\S+)(.*?)-->`)
reIncludeDirective = regexp.MustCompile(
`(?s)<!--\s*Include:\s*(\S+)(.*?)-->`,
)
)

func LoadTemplate(
Expand Down
2 changes: 1 addition & 1 deletion pkg/mark/macro/macro.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 4cfda3a

Please sign in to comment.