Pandoc: Jira reader: support anchors and anchor links

Created on 28 May 2020  路  9Comments  路  Source: jgm/pandoc

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?

bug Jira reader

Most helpful comment

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

All 9 comments

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?

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>

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

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 :thinking:

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 :)

we're not parsing anchors either

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

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

@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

@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.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

tolot27 picture tolot27  路  5Comments

johnridesabike picture johnridesabike  路  4Comments

naught101 picture naught101  路  5Comments

chrissound picture chrissound  路  4Comments

acate picture acate  路  3Comments