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

Refactors #192

Open
wants to merge 15 commits into
base: main
Choose a base branch
from
Open

Refactors #192

wants to merge 15 commits into from

Conversation

sftse
Copy link
Contributor

@sftse sftse commented Dec 16, 2024

These are the non-behavior-changing modifications from #191

The original motivation for these changes is to streamline the way the library calls itself internally. We observed some slight mismatches between how the public API exposes the configurable stages and how the library passes information internally. We investigated whether those mismatches were a bug, but thankfully they were not. Still, the changes we suggest make this clearer by using higher-level functions where possible.

sftse added 14 commits December 10, 2024 11:07
…municate to later stages

The following code can easily be mistaken for using the context to
store information retrieved by render_to_lines. This is actually not
the case.

let mut context = self.make_context();
self.do_parse(&mut context, input)
      .render_with_context(&mut context, 100, self.decorator);
Note that it does not hold that HtmlContext::default() == config::plain().make_context()
but the relevant fields used by fn parse_with_context() are the same.
This is a bit unclear, so this change makes this more transparent.
@sftse sftse mentioned this pull request Dec 16, 2024
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

Successfully merging this pull request may close these issues.

1 participant