mdsplit icon indicating copy to clipboard operation
mdsplit copied to clipboard

Correct internal cross-references when splitting the markdown file

Open fbuchinger opened this issue 2 years ago • 1 comments

It would be great if mdsplit could also fix markdown cross-references like [text](#target) (where target is a link to an internal heading) if link and target are no longer in the same file.

Same goes for relative image links in the input markdown that are no longer valid in the split output markdown.

fbuchinger avatar Aug 25 '23 13:08 fbuchinger

That's a good suggestion, but as I have no time to work on mdsplit I can not implement it myself.

If somebody wants to implement it: I guess a 2-pass approach would make sense since now the splitting process streams the file (and can thereby handle extremely large files without problems since only a few lines are kept in memory at a single time). So resolving the links would definitely require either a change to the streaming approach or a post-processing step.

markusstraub avatar Sep 03 '23 12:09 markusstraub