mirror of
https://github.com/xoofx/markdig.git
synced 2026-02-13 13:54:56 +00:00
"Label" property of LinkInline never used? #143
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @GordonApplepie on GitHub (Oct 17, 2017).
I am trying to add some extension to the link label to force some alterations.
for example:
Download me for [example:Android](http://google.com)These things I would expect:
But none of this is happening.
@xoofx commented on GitHub (Oct 17, 2017):
Yeah, it is probably confusing I agree, but it comes actually from the markdown specs (but the C# doc should better explain this, indeed). If you look at the specs for links, there are two kinds of links:
[example:Android](http://google.com))The label is an information only valid for reference links. Typically in the following reference link example:
Here the label will be
my_label.For the inline link
[example:Android](http://google.com), the informationexample:Androidis called thelink textin the specs and it will be stored as a child of theLinkInlineelement. Why? Because you can have formatting inside this text (like emphasis, code...etc.), so you don't get just a text node but you could have also formatting elements there.In the LinkInlineRenderer, you can verify here that the content of the link (its text) is rendered using the children.
Hope it makes sense.
@GordonApplepie commented on GitHub (Oct 17, 2017):
Since there is an LinkReferenceDefinition class the class property "Label" is not really used, is it?
We already suspected that this is due to the fact that there could be other markup in the link.
@xoofx commented on GitHub (Oct 17, 2017):
In the example I gave above, the Label should have the "my_label" string and the Reference (LinkReferenceDefinition) set. It is indeed a duplicate of what you could get from Reference, but the
LabelSpanis on the contrary link side (and not definition side).@GordonApplepie commented on GitHub (Oct 17, 2017):
understand, thx