Modified RegEx for Header Paragraph style to include images / Negative matching glob #581
LukasAllmer
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hey guys. I had some trouble with the standard Header Paragraph style RegEx.
I also export my notes via pandoc to pdf, and the markdown requires a newline before and after images, so the regex would stop on encountering a newline.
I modified the original RegEx string that was
^#+(.+)\n*((?:\n(?:^[^\n#].{0,2}$|^[^\n#].{3}(?<!<!--).*))+)
to^#+(.+)\n*((?:\n*(?:^[^\n#].{0,2}$|^[^\n#].{3}(?<!<!--).*))+)
Match with old string
^#+(.+)\n*((?:\n(?:^[^\n#].{0,2}$|^[^\n#].{3}(?<!<!--).*))+)
:Match with new string
^#+(.+)\n*((?:\n*(?:^[^\n#].{0,2}$|^[^\n#].{3}(?<!<!--).*))+)
:I couldn't find anyone having the same issue as me, so I thought I'd make this thread. The change is small, and I don't know if it breaks anything, so I'd appreciate if a maintainer could add it to the wiki-page if it makes sense.
Thanks a lot to the creators. This plugin is excellent.
Also I modified the ignored files glob so it ignores any files that aren't in a "anki" folder:
**/!(anki)/*
. Not sure if this is worth mentioning, but I had to remove the ID-tag from all my notes with a script because I thought the "Scan Directory" field would accept a glob as well. But it's all good. Didn't freak out at all or anything suddenly having 983 Anki cards and an unknown amount of fucked up files.Beta Was this translation helpful? Give feedback.
All reactions