fix: Properly handle macro when extracting Metadata

When a macro is set in the header, only the first line will be read and then
discarded. This makes sure we keep the macro in and stop processing metadata
when we hit a macro.

Co-authored-by: Manuel Rüger <manuel@rueg.eu>
This commit is contained in:
Guillaume Hérail
2023-01-25 13:08:08 +01:00
parent 667e7be221
commit 1b3c7b4127
2 changed files with 12 additions and 2 deletions

View File

@@ -120,6 +120,9 @@ be replaced with specified template:
<yaml-data> -->
```
**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 <regexp> which can be later
referenced in the `<yaml-data>` using `${<number>}` syntax, where `<number>` is
number of a capture group in regexp (`${0}` is used for entire regexp match),