Skip to content
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

KdlEntry::clear_fmt does not clear all formatting #46

Closed
nicopap opened this issue May 16, 2022 · 0 comments
Closed

KdlEntry::clear_fmt does not clear all formatting #46

nicopap opened this issue May 16, 2022 · 0 comments

Comments

@nicopap
Copy link
Contributor

nicopap commented May 16, 2022

I would expect clear_fmt to discard all formatting, including the representation of value (as described by the documentation of the method itself). But currently, it doesn't do such thing.

nicopap added a commit to nicopap/kdl-rs that referenced this issue May 16, 2022
@nicopap nicopap changed the title KdlEntry::clear_fmt does clear all formatting KdlEntry::clear_fmt does not clear all formatting May 16, 2022
@zkat zkat closed this as completed in bfe0682 Jun 10, 2022
zkat pushed a commit that referenced this issue Jun 11, 2022
Fixes #46

When comparing two different `KdlNode` or `KdlDocument`, it's useful to
have a "canonical" representation where formatting differences do not
matter.

`clear_fmt` removes all formatting from a `KdlNode`, but does not apply
recursively, as a result, it doesn't create a canonical representation.
`clear_fmt_recursive` solves this by applying `clear_fmt` recursively to
the contents of the node.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant