mattbrictson / chandler

[unmaintained] chandler syncs your CHANGELOG entries to GitHub's release notes
MIT License
152 stars 15 forks source link

strip markdown links #27

Closed glensc closed 7 years ago

glensc commented 7 years ago

my CHANGELOG.md contains links, so that viewing changelog online makes references also as links

 - replace xmlrpc implementation with phpxmlrpc/phpxmlrpc, [#1]
[#1]: https://github.com/eventum/rpc/pull/1

https://github.com/eventum/rpc/blob/v4.0.0/CHANGELOG.md

however the parens are kept, and thus rendered differently:

image

https://github.com/eventum/rpc/releases/tag/v4.0.0

mattbrictson commented 7 years ago

Thanks for the report. Perhaps Chandler is misinterpreting your changelog. I'll take a look.

mattbrictson commented 7 years ago

So, the problem is that Chandler doesn't really understand Markdown. It simply splits up the changelog by section heading. For example, in your changelog it uses this chunk for 4.0.0:

## [4.0.0] - 2016-11-23

 - replace xmlrpc implementation with phpxmlrpc/phpxmlrpc, [#1]

This is the text that Chandler submits to GitHub. Since the footnote for [#1] is not included, GitHub doesn't know that [#1] is supposed to be a link. So it interprets it verbatim, which is why you still see the brackets in the release notes on GitHub.

(The reason that GitHub still makes #1 a hyperlink is coincidental: GitHub automatically turns anything that looks like an issue/pull request number into a link.)

You have a couple of options:

  1. Remove the hyperlinks entirely. GitHub will still atomically recognize them as links because they follow the issue/pull request auto-linking format.
  2. Use inline Markdown links, like this: [link](http://url).
  3. Move the footnote into the same section as the link, as follows:
## [4.0.0] - 2016-11-23

 - replace xmlrpc implementation with phpxmlrpc/phpxmlrpc, [#1]

[#1]: https://github.com/eventum/rpc/pull/1

I think making Chandler intelligently parse and reformat Markdown footnotes is too complicated and is beyond my intended scope for this project. Let me know if the workarounds I described above are an acceptable fix from your perspective.

glensc commented 7 years ago

thanks for the detailed review, but unfortunately i knew it all before, and do not want to make links inline, and it still doesn't solve [4.0.0] brackets issue.

that's why i submitted this issue for chandler to strip the []-s.

i was thinking that either just dumb strip of them, or parse whole document and detect if the 4.0.0 (example) used to be a link, if yes strip, if not, keep the []-s.

glensc commented 7 years ago

ok, i need to move 4.0.0 also to the same section

glensc commented 7 years ago

however, 4.0.0 will be included in title area, so there can't be link, the []'s must be stripped.

btw, i'm following keepachangelog

glensc commented 7 years ago

ok, solved the [#1]-issue by moving footnotes to same version section. however the title issue is from #24: chandler sets it to 3.0.0, but i wish it to be 3.0.0 - 2014-11-27 as the line in changelog file.

mattbrictson commented 7 years ago

Thanks for following up. I'll consider this issue resolved.