platers / obsidian-linter

An Obsidian plugin that formats and styles your notes with a focus on configurability and extensibility.
https://platers.github.io/obsidian-linter/
MIT License
1.18k stars 80 forks source link

Bug: forbidden character combinations while copy & pasting the text of a website to a note #1068

Closed merlinuwe closed 4 months ago

merlinuwe commented 5 months ago

I have this note:

image

with this markdown:


---
aliases: [avm, Fritz, Fritzbox, AX, Router, ntp, timeserver]
tags: [avm, FritzBox, Fritz, AX, Router, privat, account, ntp, timeserver, Zeitserver, Braunschweig]
filename: muell-Linter
erstellt: Donnerstag, 22. Februar 2024, 10:24:46 Uhr
geändert: Samstag, 06. April 2024, 22:48:11 Uhr
---

`

#`

If I linter it, the first "[" after "tags:" is deleted and at the end there is a ", `" instead of a "]":

image

muell-Linter.md

This causes after lintering again this error message:

image

(Background: I copied the text part of this website https://www.cyberciti.biz/faq/linux-unix-bsd-is-ntp-client-working/ and pasted it into a note. This error occured, but I've narrowed it down.)

It would be nice, if your linter plugin could recognize issues like this and repair them.

pjkaufman commented 5 months ago

Hey @merlinuwe . I am having a bit of trouble understanding exactly what happened here. I have some speculation around this which leads me to believe this a bug with move tags to frontamatter. I am guessing this rule is enable and it assuming that #\`` is a tag (that would be a regex fix to fix that issue if it is causing the issue). The tag array type is probably what is causing the removal of]and]` which is valid in Obsidian, but not elsewhere).

However I am not sure if that is the case. Could you provide your data.json or confirm that disabling that rule fixes the problem? If it is caused by that I can probably fix it pretty easily by adding ``` to the list of invalid tag characters.

merlinuwe commented 5 months ago

Sure, here is the file.

data.json

pjkaufman commented 4 months ago

Sorry about the delay. I believe I have a fix for this issue.

pjkaufman commented 4 months ago

The changes for this should now be on master and should go out with the next release. Please let us know if either is not the case.