-
-
Notifications
You must be signed in to change notification settings - Fork 28
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
Codeblocks should not be parsed #12
Comments
Hey @anakojm I guess regex lookarounds should work for this use case, this would ideally nail the regex down to only those matches that are not written in between triple quotes If you would like to give it a shot, feel free to add a test case for this in the md marks suit |
I am willing to try but one problem I am facing is that I can't do something like that I think you would be better off dealing with this issue as I lack experience in the matter. Also why did you restrict the issue to the marks processor? In the meantime, I have written test cases, should I PR them? Maybe in another branch? |
Alright I see
Good point, have overseen the change in the second line of the example 🙈 If we want to point out the issue clearly and avoid misunderstandings, we can use the diff block on GH 😉 ```python
- if foo==bar and foo==baz:
+ if foo<mark>bar and foo</mark>baz:
- L = [[12,42],[13,90]]
+ L = [12,42],[13,90]({{< ref "12,42],[13,90" >}})
```
Cool, yes that would be awesome, maybe an extra branch like |
This might do the trick since Python 3.6: wiki_link_regex = r"(?ms:```.*?```)|\[\[(.*?)\]\]"
for match in re.finditer(wiki_link_regex, text):
if not match.group(1):
continue |
it might work but i believe the problem is more fundamental. we can’t parse markdown with regex properly since markdown is not a regular language. |
Obsidian-to-hugo wrongly convert the following:
to
Codeblocks should instead be skipped to prevent such false positives (I have no idea how to implement this).
The text was updated successfully, but these errors were encountered: