v21.1.0
New Features
-
Improve CommonMark conformance testing output
This is a major improvement to the rendering of the failing
CommonMark conformance test output, that should make it easier
to read and understand when pulldown-cmark-to-cmark is producing
erroneous output.Additionally, this introduces a way to force the printing of the
CommonMark failure report from the command line:$ FULL_CMARK_RESULTS=true cargo testand documents in CONTRIBUTING.md that new contributors may want
to start with trying to improve conformance.This removes
#[should_panic]from the main CommonMark test. Instead,
we now hard-code in how many of the CommonMark tests are known to pass.If the number that actually passes increases or decreases, this test
will fail, informing the user either that they have introduced a bug
(decrease), or that they've successfully improved conformance (increase).Previously, if a change accidentally reduce the conformance, there was
no easy way to know, since that information was not stored/tracked
in any way.
Other
- Drop comment headers
Refactor
-
Add Repeated utility to simplify writing repeated content
-
Move and group related code
My impression reading through the code in this project is that
top-level statements have gotten a bit intertangled over time;
this tries to reorder things to have a clearer flow and
structure, grouping related things together.For example, this moves the recently added Error enum up above
all of the API functions, instead of leaving it somewhat
arbitrarily nestled betweencmark_resume_with_options()and
cmark_resume_one_event().No code changes were made to the body of functions or types.
This also does not change any of the public APIs, only where
code is located.-
Group padded newline logic at top of text_modifications.rs
-
Rename
padding_of()tolist_item_padding_of() -
Add 'Public API Functions' header in lib.rs
-
Consolidate public enum and struct types at the
top of lib.rs, instead of leaving them scattered
amongst thecmark*()public functions. -
Consolidate the two
impl State<'_>statements -
Move
cmark_resume(),cmark()andcmark_with_options()
from the bottom of lib.rs up to the top, before the ~600
implementation ofcmark_resume_one_event()that makes up
the bulk of lib.rs
-
-
Add State::set_minimum_newlines_before_start()
This should help with readability. As an example, I didn't realize
initially that all of theifstatements updated in this PR
were actually modifying the same field.But once I started doing the more generic refactoring of adding
aset_option_minimum()method, I looked at every line and
realized they were all the same.Factoring this to a method should clarify to future readers that
updating newlines_before_start specifically is a recurring operation. -
Use
write_padded_string()in a couple additional places
Additionally, while in the neighhborhood, addpub(crate)to the other
text_modifications.rs private helpersThese being marked as
pubis misleading since thetext_modifications
module is not actually externally public, and these functions
are never re-exported publicly.
Commit Statistics
- 12 commits contributed to the release.
- 264 days passed between releases.
- 6 commits were understood as conventional.
- 0 issues like '(#ID)' were seen in commit messages
Commit Details
view details
- Uncategorized
- Release pulldown-cmark-to-cmark v21.0.0 (d69f748)
- Merge pull request #104 from ConnorGray/connorgray/refactor-5 (bf34a3c)
- Add Repeated utility to simplify writing repeated content (942c42b)
- Merge pull request #103 from ConnorGray/connorgray/refactor-4 (3005f1b)
- Drop comment headers (5b93e7e)
- Move and group related code (30b706b)
- Merge pull request #102 from ConnorGray/connorgray/revamp-conformance-testing (3169307)
- Merge pull request #101 from ConnorGray/connorgray/refactor-3 (ac3aaec)
- Merge pull request #100 from ConnorGray/connorgray/refactor-2 (29c8c20)
- Improve CommonMark conformance testing output (91ffc95)
- Add State::set_minimum_newlines_before_start() (31a49d0)
- Use
write_padded_string()in a couple additional places (3ab278b)