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

Jira reader: support anchors and anchor links #6407

Closed
W1M0R opened this issue May 28, 2020 · 9 comments
Closed

Jira reader: support anchors and anchor links #6407

W1M0R opened this issue May 28, 2020 · 9 comments

Comments

@W1M0R
Copy link

W1M0R commented May 28, 2020

This Pandoc markdown produces the correct Jira markdown.

This Pandoc markdown produces the correct Jira markdown.

This Jira markdown produces the incorrect Pandoc markdown.

This Jira markdown produces the incorrect Pandoc markdown.

@tarleb Do you agree regarding my observations on this?

@W1M0R W1M0R changed the title Jira: issues with anchor links Jira: anchor links rendering incorrectly in Pandoc markdown target May 28, 2020
@W1M0R W1M0R changed the title Jira: anchor links rendering incorrectly in Pandoc markdown target Jira: anchor links in header and body rendering incorrectly in Pandoc markdown target May 28, 2020
@tarleb
Copy link
Collaborator

tarleb commented Jun 13, 2020

I tried with both "incorrect" versions, and neither produced a link for me in Jira. I don't think we can do any better than what we do now. Does it work for you, and which Jira version are you using?

@mb21
Copy link
Collaborator

mb21 commented Jun 14, 2020

According to the documentation, the anchor syntax is as follows (and I can roughly confirm in jira v8.5.1):

{anchor:x}

[link|#x]

so this should produce the following HTML (modulo some paragraphs):

<a name="x"></a>

<a href="#x">link</a>

funnily, foo{anchor:x}bar produces:

<p>
  foo<a name="x"></a>bar
</p>

@mb21 mb21 changed the title Jira: anchor links in header and body rendering incorrectly in Pandoc markdown target Jira reader: support anchors Jun 14, 2020
@mb21 mb21 changed the title Jira reader: support anchors Jira reader: support anchors and anchor links Jun 14, 2020
@tarleb
Copy link
Collaborator

tarleb commented Jun 14, 2020

Ah, right! We are not actually parsing links to anchors at all! Fixing it now. Thanks!

@tarleb
Copy link
Collaborator

tarleb commented Jun 14, 2020

Which, btw, means that the current cloud jira has a bug. Anchor links are only parsed in the preview, but fail to render in the actual ticket 🤔

@mb21
Copy link
Collaborator

mb21 commented Jun 14, 2020

We are not actually parsing links to anchors at all! Fixing it now.

thanks! and yes, we're not parsing anchors either :)

Which, btw, means that the current cloud jira has a bug. Anchor links are only parsed in the preview, but fail to render in the actual ticket

yeah, I observed something similar. I think the feature only really works in confluence, but they use the same parser, so the syntax is valid in jira tickets, but the anchors just get stripped on save... or something like that :)

tarleb added a commit to tarleb/jira-wiki-markup that referenced this issue Jun 14, 2020
Parse links to anchors and treat them like normal links.

See: jgm/pandoc#6407
tarleb added a commit to tarleb/jira-wiki-markup that referenced this issue Jun 14, 2020
Parse links to anchors and treat them like normal links.

See: jgm/pandoc#6407
@tarleb
Copy link
Collaborator

tarleb commented Jun 14, 2020

we're not parsing anchors either

Could you give an example for that? It seems to work ok from what I can tell.

@tarleb tarleb closed this as completed in 16889a0 Jun 14, 2020
@mb21
Copy link
Collaborator

mb21 commented Jun 14, 2020

ah yes, anchors actually work.. (I tested on an older version..) nice!

@0xDAFE
Copy link

0xDAFE commented Jul 13, 2020

@tarleb Sorry I don't want to hijack this Issue but I see it most fitting here:

We have a special case where the link text in Jira Markup contains square brackets, e.g.
Please refer to [[3]|#appendix]

Unfortunately, this is converted to the following HTML:

<p>Please refer to [[3]|#appendix]</p>

instead of expected:

<p>Please refer to <a href="#appendix">[3]</a></p>

Edit: Link to pandoc online example

@tarleb
Copy link
Collaborator

tarleb commented Jul 13, 2020

@0xDAFE please open a new issue for this, ideally with a fully reproducible example and description of the Jira version which you are using. I entered the above into Jira cloud, but got the same output as produced by pandoc.

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

No branches or pull requests

4 participants