jsarafajr / slackify-markdown

Convert markdown into Slack-specific markdown
MIT License
129 stars 25 forks source link

Handle link and image references #21

Closed 72636c closed 3 years ago

72636c commented 3 years ago

This adds handlers for the ImageReference and LinkReference nodes to resolve them down to Slack-compatible links. It doesn't seem possible to look up Definition nodes from the handler arguments, so we crawl the AST beforehand to manually build up our own record, then remove the nodes so that they do not clog up the output with awkward newlines.

Relevant nodes:


This is currently built on top of #20, but I can rebase this on master if you don't want to go ahead with that change.

jsarafajr commented 3 years ago

LGTM, thanks :)

Looks like it has some conflicts now, will merge once conflicts are resolved.

jsarafajr commented 3 years ago

Published in slackify-markdown@v4.1.0