mark
mark copied to clipboard
Include header doesn't work when placed right after title header
What happened?
Adding an Include header right after a Title header doesn't work, e.g:
<!-- Title: Test -->
<!-- Include: macros.md -->
:children:
The only way to solve it to add an additional newline between both headers
What did you expect to happen?
The include statement above should work
How can we reproduce the behavior you experienced?
- Create the following file
macros.md
<!-- Macro: :box:([^:]+):([^:]*):([^:][\s\S]*?):
Template: ac:box
Icon: true
Name: ${1}
Title: ${2}
Body: ${3} -->
<!-- Macro: :children:
Template: ac:children
-->
<!-- Macro: :updated:
Template: ac:recently-updated
-->
- Create the following file
test.md
<!-- Title: Test -->
<!-- Include: macros.md -->
:children:
- Export your mark params env vars (
MARK_BASE_URL,MARK_SPACE,MARK_USERNAME,MARK_PASSWORD) - Run
mark -f test.md --include-path "." --dry-run --debug - You should get the below compiled HTML (wrong output):
<p>:children:</p>
- Now add a newline between the title and include headers in the previous file
test.md:
<!-- Title: Test -->
<!-- Include: macros.md -->
:children:
- If you run step
4again, now you get the right output:
<p><ac:structured-macro ac:name="children"></ac:structured-macro></p>
Further Information (please complete the following information)
- Mark Version (
mark --version): 9.12.0 - Mark Parameters: No additional params
- Confluence Hosting: Datacenter
- Confluence Version: N/A
- Environment specific Information: Ubuntu/WSL
Yeah it looks like when it's part of the header, it gets ignored here: https://github.com/kovetskiy/mark/blob/fad9866b416256415a13ad4daf338c8c7347ef2a/pkg/mark/meta.go#L114 probably rather should call ProcessIncludes and feed them back into the file.