kovetskiy / mark

Sync your markdown files with Confluence pages.
https://samizdat.dev
Other
977 stars 143 forks source link

\s* is useless without (.*?) #379

Open Skeeve opened 9 months ago

Skeeve commented 9 months ago

https://github.com/kovetskiy/mark/blob/8e16f6f29c6dc3d81e24f5f8d90bf411d8c8a402/pkg/mark/meta.go#L45

The pattern (.*)\s*--> will always put all whitespace in the capturing group as *is greedy. To exclude them use (.*?)˜s*--> to make the * non-greedy. Alternatively leave the \s* out.