mirror of
https://github.com/xoofx/markdig.git
synced 2026-02-11 13:54:50 +00:00
LinkReferenceDefinition source position is ignored in NormalizeRenderer #286
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 @xp44mm on GitHub (Mar 27, 2019).
the test is follow:
the test file is, need remove the .txt extent name:
Markdown Reference.md.txt
please note that Footnotes, Reference Links, URLs, this is normalized file:
Markdown Reference.md.txt
@xoofx commented on GitHub (Mar 27, 2019):
Can you explain what fails exactly?
@xp44mm commented on GitHub (Mar 27, 2019):
when without use advanced, left side is normed, right side is source.

@xp44mm commented on GitHub (Mar 27, 2019):
i remove some config:
maybe the link reference definition move all to first occurency together from article bottom.
@xoofx commented on GitHub (Mar 27, 2019):
Oh, yes, the
NormalizeRendereris by far not compatible with all extensions. It requires still lots of work and I have personally zero spare time left for that. so PR welcome. See also issue #155@xp44mm commented on GitHub (Mar 27, 2019):
left side is normed, right side is source.

@xoofx commented on GitHub (Mar 27, 2019):
as I said, it is a known issue, look at #155 and you will see that most extensions are not supported by normalize, and even the core part of CommonMark might not be entirely supported well.
@xp44mm commented on GitHub (Mar 27, 2019):
hello! i read the code, i guess the bug not in normalize, insteed, bug in parser. i use regex and f# , C# i just read can't write. manapulate char and use ref to modify source code beyond my job.
allow more than one
LinkReferenceDefinitionGroupin a doc. for example, there is a gourp per every section, and a doc has many sections. next code seem expression one group in a document. that will merged all groups into first. no respect source.354db6b306/src/Markdig/Syntax/LinkReferenceDefinitionExtensions.cs (L48)i think the action of
LinkReferenceDefinitionGroupsemilar toQuoteBlocks, continuousLinkReferenceDefinitionis a group, interval other block'sLinkReferenceDefinitionbelong another group. actually, i thinkLinkReferenceDefinitiondon't need be pushed into group, they can seperate beings just like common paragraph.you let it unique in a doc is for building association between title and link definition. but i think latter not so nessassary to add complex. i still think that computer can auto link source to target is a super cool action!@MihaZupan commented on GitHub (Mar 27, 2019):
Yes, the approach with a single
LinkReferenceDefinitionGroupwould have to be changed for theNormalizeRenderer. For theHtmlRendererit was okay since the location of the definition does not matter for the overall document.@xoofx commented on GitHub (Mar 27, 2019):
Yeah, as @MihaZupan suggested, originally markdig was mainly and only developed for HTML rendering. NormalizeRenderer has been added later, but is far from completed, and it will probably never be completed if nobody in the markdig userbase is willing to contribute fixing it. And that's lots of work.
@xp44mm commented on GitHub (Mar 27, 2019):
yes, the NormalizeRenderer is inverse of parser. it can help to test the parser if respect raw text. so hope to develop consistly.