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

Heading Anchors are not translated to confluence rules #492

Open
DerGary opened this issue Aug 21, 2024 · 6 comments
Open

Heading Anchors are not translated to confluence rules #492

DerGary opened this issue Aug 21, 2024 · 6 comments
Labels

Comments

@DerGary
Copy link

DerGary commented Aug 21, 2024

What happened?

I wrote my markdown file with relative anchor links to headings inside the same file and used the markdownlint suggested anchor links. These were not correctly translated to what confluence expects as the anchor links.

Example 1:

# Jobs

[link](#jobs)

Resulted in link: #jobs
but Confluence is expecting it to be case sensitive, it should therefore be #Jobs

Example 2:

# this/is_some_heading.yml

[link](#thisis-some-headingyml)

Resulted in link: #thisis-some-headingyml
but Confluence is expecting it to contain symbols like this: #this/is_some_heading.yml

It is not possible to change it beforehand because it won't work in the markdown file anymore.

What did you expect to happen?

Mark should check the markdown anchor links and translate them to the expected Confluence link style bevor generating the html for confluence.

How can we reproduce the behavior you experienced?

Steps to reproduce the behavior:

Use one of the example above with the current mark docker container.

Further Information (please complete the following information)

  • Mark Version: latest
  • Mark Parameters: --base-url ** --title-from-h1 --drop-h1 --edit-lock --minor-edit --ci
  • Confluence Hosting: Cloud
  • Confluence Version: unknown
  • Environment specific Information: running in azure devops pipelines
@DerGary DerGary added the bug label Aug 21, 2024
@DerGary DerGary changed the title Heading Anchors do not work as expected Heading Anchors are not translated to confluence rules Aug 21, 2024
@mrueg
Copy link
Collaborator

mrueg commented Sep 9, 2024

See also #47

@mrueg
Copy link
Collaborator

mrueg commented Oct 22, 2024

#522 includes a fix to make sure that anchors are case sensitive as confluence expects them to be.

@mrueg
Copy link
Collaborator

mrueg commented Oct 22, 2024

@DerGary this will be released in 11.3.0

Please let me know if it fixes the problem you see.

@DerGary
Copy link
Author

DerGary commented Oct 22, 2024

@mrueg unfortunately it seems like it does not fix the issue. I briefly looked over the changes of your pull request and I could not find any changes regarding to links, just headings. But the problem that I was trying to explain is that the link created by mark when the link syntax is used like this: [link](#jobs) must be translated to the Heading name wich is Jobs. One way that I could think of would be to create a list of all possible anchors and match them case sensitive and replace the Link with that or another way might be to create an additional anchor that matches jobs that should be added in the HTML.

@mrueg
Copy link
Collaborator

mrueg commented Oct 22, 2024

For the link anchors, I think there's no good way to know which one is correct and how to translate them. I thought this issue was about auto generated IDs from the headers, which should now match more closely what confluence expects.

@DerGary
Copy link
Author

DerGary commented Oct 23, 2024

@mrueg Is it possible to add a second anchor to each heading that matches the markdown spec of link fragments?

e.g:
<h1 id="This/is-some_Heading.yml"><span id="thisis-some_headingyml">This/is some_Heading.yml</span></h1>

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