-
Notifications
You must be signed in to change notification settings - Fork 52
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
Upgrade mistune #81
Draft
galund
wants to merge
12
commits into
iamjackg:develop
Choose a base branch
from
alphagov:upgrade-mistune
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Upgrade mistune #81
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- header renderer function renamed to heading and args changed - link arguments changed - block_code arguments changed - image arguments changed and local filepath needs URL-decoding NB work in progress - tests not fixed
… separate elements - new Mistune behaviour is correct - we're trying to test a single blockquote with multiple paragraphs (where only the first line of each para has an angle bracket) - so add the exrta angle bracket on the blank line, to correspond with the intended output
- no change to semantics of the output markup
… markup - there is a substantial difference betwen the [syntax previously assumed](https://daringfireball.net/projects/markdown/syntax#list) and the [CommonMark syntax](https://spec.commonmark.org/0.30/#start-number) - Mistune now follows CommonMark so the example doc must change Arguably the example doc here is not testing md2cf functionality and should be removed - It's not particularly useful to test a lib that we depend on, unless we are testing something that matters to Confluence - Even then, deviation from CommonMark is not helpful, though potentially we could flag a warning somehow
…ownRenderer - all code blocks end with a newline - this means updating some examples in the functional test as they expected inconsistency
- add functional test of language tag on code block - fix unit test for block_code given renamed parameter
- turns out this is easy to break as Mistune behaviour has changed
…ue to the Mistune upgrade - each text callback occurs with a single line/token so doesn't receive the newline - instead we define a special InlineParser that handles soft break as spaces rather than newlines
"remove-text-newlines" isn't removing all the newlines it could/should at the moment :( |
This was referenced Sep 15, 2023
Closed
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Several substantial changes to the Mistune API, requiring alteration to our custom renderer.
Many of the changes do result in a different rendering, and where I've judged these are probably acceptable I've adjusted the tests, rather than attempt to further customise the markdown handling.
This targets a release candidate of Mistune 3, as it didn't seem worth trying to target version 2 given the newer version's impending availability.