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

Support for <AutoLink> and link reference definition associations. #20

Closed
wants to merge 2 commits into from

Conversation

pcj
Copy link
Contributor

@pcj pcj commented Sep 22, 2015

  • An abstract node 'Reference' that captures the link label, title,
    description attributes for subclasses Link, Image, AutoLink.
  • AutoLink node class that allows Visitor to differentiate between
    inline links and types.
  • Support in the InlineParserImpl to capture the association between
    links and link reference definitions.
  • static Debugging functions

- An abstract node 'Reference' that captures the link label, title,
  description attributes for subclasses Link, Image, AutoLink.
- AutoLink node class that allows Visitor to differentiate between
  inline links and <autolink> types.
- Support in the InlineParserImpl to capture the association between
  links and link reference definitions.
- static Debugging functions
@pcj
Copy link
Contributor Author

pcj commented Sep 22, 2015

Looking into that test failure.

@@ -0,0 +1,17 @@
package org.commonmark.node;

public class AutoLink extends Link {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It makes sense that AutoLink is a separate node type.

I'm not sure about subclassing Link though. After all, it doesn't have all the attributes that a Link has (no label or title). Have you thought about having it extend Node instead?

@robinst
Copy link
Collaborator

robinst commented Sep 24, 2015

Looks like a good change, but I'm not sure about the class structure yet.

Do you think it would make sense to have [foo]: /url "title" be its own Node type, like ReferenceDefinition? Something like this maybe:

  • [foo](/uri "title") is a Link, which has getDestination, getTitle (not sure about getLabel)
  • [foo][foo], [foo][] and [foo] are ReferenceLink extends Link, which have an additional getDefinition which returns the ReferenceDefinition

Does that make sense?

@robinst
Copy link
Collaborator

robinst commented Aug 29, 2017

I've created an issue for this improvement, for which this PR can be a starting point: #98. Closing this in the meantime.

@robinst robinst closed this Aug 29, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants