Skip to content
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

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:-) steve@dvnbikers.fr

@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 join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants