Skip to content
This repository has been archived by the owner on Aug 5, 2024. It is now read-only.

Newbie, needs advice on line mode c# and markdown #116

Open
EccentricDyslexic opened this issue Aug 13, 2021 · 2 comments
Open

Newbie, needs advice on line mode c# and markdown #116

EccentricDyslexic opened this issue Aug 13, 2021 · 2 comments

Comments

@EccentricDyslexic
Copy link

EccentricDyslexic commented Aug 13, 2021

Hey peeps,

I i’m a novice programmer in C sharp I’m trying to compare to text strings stored in a database in markdown and compare them line by line. Then I’d like to be able to interpret the result so that I can add annotation in markdown to the result, for example if two lines are the same, then there is no annotation or highlighting of that lone, if a line has been deleted then it’s shown in markdown being struck-through with a line, if a line has been added it is annotated highlighted in green, or something similar that makes some kind of sense.
Any help gratefully received:-) [email protected]

@dmsnell
Copy link

dmsnell commented Aug 16, 2021

@EccentricDyslexic good luck with whatever you are doing. a couple points here:

  • remember that Markdown shares syntax with HTML and thus you can find some changes with newlines and whitespace that don't change the semantic meaning of the content. a diff of the Markdown markup might reveal changes where the different outputs are identical
  • you can use the output from line mode from diff-match-patch and process it to get those results. the output is straight-forward with insert, delete, and equal indicators for each chunk/line. you'd need to interpret that output yourself though, meaning you take the diff output and print out HTML/Markdown with the appropriate annotations on your own

Does that help?

@EccentricDyslexic
Copy link
Author

EccentricDyslexic commented Aug 16, 2021 via email

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants