-
-
Notifications
You must be signed in to change notification settings - Fork 53
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
Fix serde, change BlockQuote
-> Blockquote
#135
Conversation
@@ -264,6 +264,9 @@ The following bash scripts are useful when working on this project: | |||
```sh | |||
RUST_BACKTRACE=1 cargo test | |||
``` | |||
```sh | |||
RUST_BACKTRACE=1 cargo test --features json | |||
``` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you recommend that humans run both commands? One or the other?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can be replaced with 'cargo test --all-features'
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok, can you do that? One test example, with all-features
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
Thanks for your PR!
Are you saying that currently (main branch) the Are you interested in adding, as you note in your OP, some more tests? |
No, in the main branch it is 'blockquote', and matches the mdast. I had to remove the 'type' on the individual enums and replace with 'rename_all=camelCase' on the 'Node'. It seems like we cannot correctly specify tagging on individual constructs. It is resulting in duplicate tags like shown below. I do not like the solution of depending the convention of the camelCase. But I am assuming it will never change.
Yes I started writing tests. But they are turning really verbose. I am refactoring them. |
I don’t think JSON has a limitation on non-duplicate fields? https://www.json.org/json-en.html.
fine! Changing Block Quote is 👍 for me! |
I mean deserialization failing because of above duplicate 'type'.
Yes, made the change as well. |
Right, but I am trying to point out that I do not think this is not something JSON defines. I think it is something that some libraries do: in JS, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. Are you planning to add some more tests in this PR, or separately?
Definitely adding more test cases. I will do in follow up PR. It is just taking time to write down the fixtures. Most of the content is just spans and points. |
Thanks! |
Looking forward to your other PR! |
Fixed a bug introduced with <wooorm/markdown-rs#135> renaming a enum variant.
NOTE : The included sanity test makes sure that at-least the AST serializes and deserializes. More rigorous tests should be added later. Currently, it works as the construct names 'camelCased' match the Mdast JSON except for Blockquote (changing it will be API change).
As it is still in alpha changing 'BlockQuote' enum to 'Blockquote' will make serde work completely.
NOTE: This PR makes another pending one obsolete #74