Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reference Style Links | Re-consider Marked #178

Closed
skipjack opened this issue Sep 20, 2016 · 8 comments
Closed

Reference Style Links | Re-consider Marked #178

skipjack opened this issue Sep 20, 2016 · 8 comments
Assignees

Comments

@skipjack
Copy link
Collaborator

skipjack commented Sep 20, 2016

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.

@skipjack skipjack self-assigned this Sep 20, 2016
@bebraw
Copy link
Contributor

bebraw commented Sep 21, 2016

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.

@skipjack skipjack added the Bug label Oct 29, 2016
@bdougie
Copy link
Contributor

bdougie commented Dec 30, 2016

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?

@bebraw
Copy link
Contributor

bebraw commented Dec 30, 2016

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.

@skipjack
Copy link
Collaborator Author

skipjack commented Dec 30, 2016

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.

@bdougie
Copy link
Contributor

bdougie commented Jan 3, 2017

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.

@skipjack skipjack changed the title Allow Reference Style Links Reference Style Links | Re-consider Marked Jan 31, 2017
@bdougie
Copy link
Contributor

bdougie commented Feb 14, 2017

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.

@skipjack
Copy link
Collaborator Author

skipjack commented Mar 4, 2017

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.

@skipjack
Copy link
Collaborator Author

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 😄 ).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants