Webpack.js.org: Reference Style Links | Re-consider Marked

Created on 21 Sep 2016  路  8Comments  路  Source: webpack/webpack.js.org

For some reason marked isn't parsing these correctly (see the markdown spec if you're not familiar with them). I find them very useful to keep paragraphs uncluttered for easy review and editing. This issue says they they should work, however this:

... here's a [link][1] ...

[1]: https://github.com

always gets parsed incorrectly to ...here's a [link][1]...

I'm assigning this to myself for now but anyone's welcome to take a look.

Bug Infrastructure

All 8 comments

We might want to look into some other parser as marked isn't that maintained. It would have to be possible to customize the alternative, though, as there's certain custom syntax in place.

I have had problems with marked in the past for an app at work, but figured out a workaround. I was unable to find a better solution than marked and curious to know if there is something better.

Is there an example of reference linking already being used somewhere, if not I can play around with this and look into remarkable or common mark?

The problem is that we've extended the parser with some custom syntax. That would need to be ported over to some other solution. That said, replacing marked with something maintained could be a good move.

Yea I was thinking about closing this as it doesn't seem to bother others too much and I haven't had the time to dig into it myself. However, @bdougie if you want to take a stab at using another parser or debugging this, that would be awesome. As @bebraw mentioned though, you should take a look at the markdown utility we've been using and make sure the other parsers you try out can be customized in a similar fashion.

I first tried Remarkable and found it works fine with reference linking, I did have some trouble trying to match the Markdown Utility customizations and did not proceed with it.

I did find the point of failure in Marked and it correctly parses that there are reference links, if just can't parse the reference link list, specifically this.links.length is always 0. I have been tinkering with MarkedJS code to find out why the list is being overlooked. The fix in this issue addresses finding reflinks but not the list of links.

  [1]: http://google.com/
  [2]: http://search.yahoo.com/
  [3]: http://search.msn.com/

I have reached my limit for debugging marked and not sure using marked is not the correct path. I am going to try to add Remarkable again now that I have a better understanding what the Markdown Utility is doing. This is an interesting problem, so I have no problem proceeding.

FYI, I have been a bit busy with the day job and enlisted to @rolfea to help work on this. The basics of markdown is working with the remarkable library, but the overrides and special cases don't have replacements as of yet.

I started to play around with markdown-to-react-components in the react-banner documentation and it allows reference links! The weird thing is it uses marked under the hood... I have a feeling something else we did in our markdown utility file is the root of issue.

Anyways, so far MRTC has been working well. I think maybe that'd be a good solution for us here. Pretty sure we could do all the same customization with it but in a cleaner fashion via react components.

Closing this for same reason I just closed #301, if someone wants to pick it up sooner feel free to re-open. If not, @bdougie I'll ping you down the road if once we start a real effort on #301 if you're still interested in helping out (I have pretty high hopes for MRTC 馃槃 ).

Was this page helpful?
0 / 5 - 0 ratings

Related issues

chikathreesix picture chikathreesix  路  21Comments

pksjce picture pksjce  路  34Comments

zzzgit picture zzzgit  路  31Comments

skipjack picture skipjack  路  60Comments

arecvlohe picture arecvlohe  路  21Comments