friebetill/obsidian-file-diff

Sometimes it identifies equal blocks as different

AMGMNPLK opened this issue · 4 comments

I don't know why, but sometimes it highlights the same blocks. I took both texts and compared them in other tools because maybe my eyes could fail, but they didn't find other differences.

Hi @AMGMNPLK,

Thank you for bringing this to my attention. To help me investigate further, could you please provide the problematic strings the next time they occur? It would be really helpful in pinpointing the issue.

Thanks again for your feedback!

Ok, by pasting this case I found the difference in this case, it is a space. However, when rendering the note and also in the file-diff comparison not you can see them like the same. I would be nice to see the difference so you can decide properly. I'll keep posting more samples when I see.

CleanShot 2023-11-04 at 07 09 22@2x

String 1:

# Heading blocks
The heading becomes the question and everything until the next heading is the answer

 ## Regex
Heading: `^#+ *\* *(.+)\n*((?:\n(?:^[^\n#].{0,2}$|^[^\n#].{3}(?<!<!--)[\w\W]+?(?=\n^#+ |$(?![\r\n]))))+)`

To add heading cards, format your headings like this (you must add a * )

String 2

# Heading blocks
The heading becomes the question and everything until the next heading is the answer

## Regex
Heading: `^#+ *\* *(.+)\n*((?:\n(?:^[^\n#].{0,2}$|^[^\n#].{3}(?<!<!--)[\w\W]+?(?=\n^#+ |$(?![\r\n]))))+)`

To add heading cards, format your headings like this (you must add a * )

In this case I think it is about the three last points or elipsis. If I paste them it looks the same, but in the clipboard the look different. I can't capture the screenshot for it, but it seems that according to some string systems –UTF or something like that?– they look different, like three dots it is not the same than the elipsis.

CleanShot 2023-11-04 at 19 18 03@2x

string 1

# No enamorarse de la idea/metodología, plan…

string 2

# No enamorarse de la idea/metodología, plan...

Thanks for the examples! The second example is now better displayed in the new version 1.1.0:
image