-
Notifications
You must be signed in to change notification settings - Fork 4
Add incomplete ast-based Rust implementation #4
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
base: master
Are you sure you want to change the base?
Conversation
This lacks support for quote authors, lists, and referencing past used URLs. It's also failing a few tests that I have not investigated. It's otherwise complete.
|
Great thank you in advance!
Please note that pqmarkup-like in contrast to pqmarkup does not support referencing past used URLs. Also they have a slightly different syntax: |
Ah, ok. Thank you for the clarification! I've fixed part of this - it will no longer try to produce links that wrap other links. However, the test is still failing and I'm not 100% sure what I should do. It seems like the success case ignores the second Updated test results |
Links can be started only with
|
|
@daboross |
|
I've taken a stab at this and will briefly share my experience. The TL;DR though is that, while I want this design to succeed, it gets tricky over time to replicate all of the quirks of the reference implementation simply because they are so different in architecture. It seems the two biggest missing features are blockquotes-with-sources ( Before doing that, however, I decided to try an easier feature: The and the AST looks like this: There's no newline at the end of Now, something similar to the original behavior could be achieved by emitting In the long term, I fear that I may run into even stranger quirks. For that reason, I've decided for now to focus on something closer in design to the original implementation. |
I think that it is reasonably to fix this test by adding newline at the end of an input. (Here is a fixed tests.txt.)
This was just easier to implement.
No, the code you are referencing is intended for notes (where pqmarkup-lite/pqmarkup_lite.py Lines 299 to 302 in 7d9bc7d
And the original implementation does not suppress newlines—it suppresses |
|
Whoops, sorry, I just remembered about this. I had a high-priority work-related project come up that took up all of my free time since my last message. That is more or less finished now so I can take another stab at this. |
I don't have any current plans for this. I left this PR open in case anyone else wanted to finish it, but we could also just close it.
This makes sense! I hadn't realized that, and I do mostly disagree with this design choice (I don't think markup languages should be deciding what's a valid link), but it should be fairly easy to fix in the PR. The other quirks... As @alextretyak noticed, there are a number of behaviors that seem really only replicable with the original design. This AST-based implementation can work somewhat, but I think it would take a lot of effort to create a clean and nice-looking Rust implementation that also retains compatibility with the original pqmarkup-lite. |
|
I just want to say to other/all implementers that I allow fixing tests.txt, and even the original Python implementation if there will be a good reason for that, so a blind compatibility with the original implementation is not strictly necessary. |
This lacks support for quote authors, lists, and referencing past used URLs. It's also failing a few other tests that I have not investigated.
I've ran out of steam for adding the remaining bits of support here, but I figure it's mostly complete, so I'm opening this PR in case anyone else wants to use this WIP.
This has support for running the given test cases. Here's a log of the ones currently failing:
Failing test cases