miyuchina / mistletoe

A fast, extensible and spec-compliant Markdown parser in pure Python.
MIT License
841 stars 119 forks source link

💡 implement link titles in the JIRARenderer (contrib) #161

Closed franferrax closed 2 years ago

franferrax commented 2 years ago

Sample Markdown:

Sample: [inner](https://target "title")

In Linux, test with:

mistletoe -r contrib.jira_renderer.JIRARenderer <(echo 'Sample: [inner](https://target "title")')

Jira result, before this PR changes:

Sample: [inner|https://target]

Jira result, after this PR changes:

Sample: [inner|https://target|title]
franferrax commented 2 years ago

@franferrax, great, thanks for your contribution.

Do I see it right, that while this works, it doesn't seem to be documented (or anywhere else) by Atlassian?

Oh you are right! I know that documentation, I just discovered this by accident and hadn't realized this isn't there. Feel free to discard this PR if you prefer to only implement well documented features.

Next, do you think you could also add a unit test to cover this new feature? I think cloning and extending the existing test_render_link() as test_render_link_with_title() could be sufficient. :)

Yes, I'll try to do that in a separated commit.

franferrax commented 2 years ago

@pbodnar: this PR is now ready for re-review, I've amended and force-pushed 369a5f52459b7039c17ffc671fd04cb3b53726ce → d0cb67e697276b668995c866017edf1ed22a032e to include commented suggestions. I've added test_render_link_with_title(), checked it is passing, and temporarily removed my changes to check it fails.

pbodnar commented 2 years ago

@franferrax, thanks for having quickly implemented the requested changes. :)

@franferrax, great, thanks for your contribution. Do I see it right, that while this works, it doesn't seem to be documented (or anywhere else) by Atlassian?

Oh you are right! I know that documentation, I just discovered this by accident and hadn't realized this isn't there. Feel free to discard this PR if you prefer to only implement well documented features.

I tried to Google again and I still couldn't find anything on this Jira markup feature, like since which version of Jira it is available. Yet, I think this PR makes sense and it is probably safe to be merged.

So only just for sure, for the case someone follows us, I would leave it still open for a while (like a week or two), giving them a chance to challenge this change. :))