-
-
Notifications
You must be signed in to change notification settings - Fork 445
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
Replacing LinkInline with reference form - how? #752
Comments
ok, this seems not to work at all - and the little documentation that there is is never high level. I try to isolate links and put them back using references.. My current code:
results in links being replaced with [] - no url inside, no reference group being written to the end. What am I doing wrong? To my understanding creating a new link and putting it in place of the old one is the way to go, and as I re-hook the content (child) - that should also work? I tried the documentation, but there is only it seems a property by property without any higher-level explanation or examples, so one is left to - not even sure what. I do not even understand why the LinkRefrerenceDefinition is not rendered at the end - it IS in the document. |
Both statements are confusing. What is the link between the two? Extracting links in the document is one problem. But you are also saying that you are rewriting the document. Is it for generating HTML or to generate back Markdown? This is not clear. |
I am generating markdown back - the issue is that I am extracing the links because it is easier to then replace them. This is for moving documents into a complex autonomous storage system. THe document (in markdown) comes in with a link. By taking the link OUT and putting them into a reference, WHILE doing that I can as well write it into a database , then, when actually writing the document into the database, write it without the link references. Upon generating for output, the then CURRENT links (the URL's they point to may change) are easily reconsstructed. The business problem here is that the input markdown is in one language, but the otuput system must handle references to translated langauges - which all have their own URL, hence the target URL is put in when presenting. |
Looking at the code, |
Well, I have no problem dumping the reference definitions myself - but my problem is that I have no idea how to get the LINKS to show them. Remember, Links that refer to references are in [], not in () - and I totally fail to genrate a link that does emit the proper reference code. |
This is the renderer used for generating back top Markdown. You have to look at this file to see what you should modify on a LinkInline. For example, the So, yeah, it's messy but there is no other way than to sneak around in the codebase to see how to use this. It was not designed in the first place to support this scenario. I never had a personal incentive to do it, so the person that brought it did his best for his use case, but it's far from perfect. Doing it properly would require a major refactoring/redesign of Markdig, and who wants to do that? It is multiple weeks of fulltime work, and as this project is OSS, you know, that's what you get for free. |
Trying to find documentation and I get the idea I am either not finding it - but neither is my AI.
I need to import a markdown document (thousands actually) and extract all the links so they can be maintained separately.
I found them using
probem is- what do I replace them with if I then add the references? I have the key - i Just have no idea what to put there.
It seems nto toto be a LinkReferenceDefinition - that is for the references. SO what do I replace it with? The LinkReferenceDefinition can not be it, or?
The text was updated successfully, but these errors were encountered: