Open ruv opened 3 years ago
Yes it does occasionally.
I tried diffing the markdown and diffing the output. Both have their drawbacks. I also started to write a markdown-aware-diff, but I quickly realized that this is no easy task, so I decided to stick with the current implementation. If you find a well written markdown-aware-diff I'll be happy to add it.
Until then I will close this issue, feel free to reopen it anytime if there are news on how to tackle the problem.
If you find a well written markdown-aware-diff I'll be happy to add it.
Could you please try markdown-diff library? It compares text in the markdown, and generates diff in the markdown, and keeps basic formatting (including code blocks).
Lets see how this works...
So this library seems to be doing okay with markdown in general, but code blocks were only prefixed with "+ " or "- " which was not sufficient for me to clearly see the differences. So I added some code which wraps those lines in <ins>
and <del>
I will check some more examples, @ruv do you have any proposals in mind which would also benefit from the new diff?
Oh my this is completely broken:
https://forth-standard.org/proposals/specify-that-0-throw-pops-the-0#reply-794
If some lines in a code block were changed, the formatting of the code block is broken in the web-page that shows differences. The code block is closed prematurely, and the new code block (with normal text) is started in the place where the original block is closed.
(example)