diff --git a/README.md b/README.md index 1e70b76..f288534 100644 --- a/README.md +++ b/README.md @@ -120,6 +120,9 @@ be replaced with specified template: --> ``` +**NOTE**: Make sure to define your macros after your metadata (Title/Space), +mark will stop processing metadata if it hits a Macro. + Capture groups can be defined in the macro's which can be later referenced in the `` using `${}` syntax, where `` is number of a capture group in regexp (`${0}` is used for entire regexp match), diff --git a/pkg/mark/meta.go b/pkg/mark/meta.go index 2f1a301..416182b 100644 --- a/pkg/mark/meta.go +++ b/pkg/mark/meta.go @@ -34,8 +34,9 @@ type Meta struct { } var ( - reHeaderPatternV1 = regexp.MustCompile(`\[\]:\s*#\s*\(([^:]+):\s*(.*)\)`) - reHeaderPatternV2 = regexp.MustCompile(``) + reHeaderPatternV1 = regexp.MustCompile(`\[\]:\s*#\s*\(([^:]+):\s*(.*)\)`) + reHeaderPatternV2 = regexp.MustCompile(``) + reHeaderPatternMacro = regexp.MustCompile(`