You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When trying to use inline template macros with the --title-from-h1 parameter, instead of using the leading H1 header for the Confluence page title mark is using the template name of the first macro minus its first character (i.e. if the first inline template is defined as Template: #my_template the Confluence title becomes y_template).
What did you expect to happen?
The Confluence title matches the actual leading H1 header.
How can we reproduce the behavior you experienced?
Enable the --title-from-h1 parameter.
Create a document with no <!-- Title --> header and at least one <!-- Macro --> header with an inline template defined.
Try to sync the document with Confluence.
Minimal markdown example where the Confluence title becomes nline instead of Some title:
<!-- Space: Test -->
<!-- Parent: Test -->
<!-- Macro: <test />
Template: #inline
inline: Some test
-->
# Some title
<test />
Information (please complete the following information)
Mark Version (mark --version): v9.11.1
Mark Parameters: --title-from-h1
Confluence Hosting: Cloud
Confluence Version: -
Environment specific Information: running in Github Actions
Logs or other output
No relevant logs that might highlight or help debugging the issue.
Hey @mrueg, not fully sure of what the solution you proposed implies (moving the extraction to the custom parser) but a quick fix could be to just update the regex to better fit the Markdown specification for headings. Something like this should do the job (I can open a PR to add the change together with some tests): ^\s{0,3}#\s+(.*)(\s+#+)?\s*\n
What happened?
When trying to use inline template macros with the
--title-from-h1
parameter, instead of using the leading H1 header for the Confluence page titlemark
is using the template name of the first macro minus its first character (i.e. if the first inline template is defined asTemplate: #my_template
the Confluence title becomesy_template
).What did you expect to happen?
The Confluence title matches the actual leading H1 header.
How can we reproduce the behavior you experienced?
--title-from-h1
parameter.<!-- Title -->
header and at least one<!-- Macro -->
header with an inline template defined.Minimal markdown example where the Confluence title becomes
nline
instead ofSome title
:Information (please complete the following information)
mark --version
): v9.11.1--title-from-h1
Logs or other output
No relevant logs that might highlight or help debugging the issue.
Additional context
Looks like the regex used in the
ExtractDocumentLeadingH1
function might be the culprit, as it does match the observed behaviour.The text was updated successfully, but these errors were encountered: