Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Include header doesn't work when placed right after title header #455

Open
monti-python opened this issue Jun 12, 2024 · 1 comment
Open
Labels

Comments

@monti-python
Copy link
Contributor

monti-python commented Jun 12, 2024

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?

  1. 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
-->
  1. Create the following file test.md
<!-- Title: Test -->
<!-- Include: macros.md -->

:children:
  1. Export your mark params env vars (MARK_BASE_URL, MARK_SPACE, MARK_USERNAME, MARK_PASSWORD)
  2. Run mark -f test.md --include-path "." --dry-run --debug
  3. You should get the below compiled HTML (wrong output):
<p>:children:</p>
  1. Now add a newline between the title and include headers in the previous file test.md:
<!-- Title: Test -->

<!-- Include: macros.md -->

:children:
  1. If you run step 4 again, 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
@monti-python monti-python changed the title Include statements don't work after metadata statements Include statements don't work after title header Jun 12, 2024
@monti-python monti-python changed the title Include statements don't work after title header Include header doesn't work when placed right after title header Jun 12, 2024
@mrueg
Copy link
Collaborator

mrueg commented Jul 30, 2024

Yeah it looks like when it's part of the header, it gets ignored here:

case HeaderInclude:
probably rather should call ProcessIncludes and feed them back into the file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants