-
Notifications
You must be signed in to change notification settings - Fork 164
New changelog parser + typed representation of the changelog structure. #8856
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
base: master
Are you sure you want to change the base?
Conversation
Note: I've downloaded, extracted and tested it on the latest versions of all packages from At this point I think the new parser will be an improvement, handles more edge cases, and for the rest we can add support for them case-by-case. |
app/lib/shared/changelog.dart
Outdated
if (node is html.Text) { | ||
return node.text; | ||
} else if (node is html.Element) { | ||
return node.nodes.map(_extractText).join(); |
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.
I worry that by doing recursive calls here we are subject to crash by stack-overflow...
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.
Yeah, it is probably a not really necessary item here, switching to always do node.text.trim()
(it is using a tree visitor inside, but it doesn't need such joins, it appends the text to a buffer).
app/lib/shared/changelog.dart
Outdated
}) : _strictLevels = strictLevels, | ||
_partOfLevelThreshold = partOfLevelThreshold; | ||
|
||
Changelog parseMarkdown(String input) { |
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.
Does the input get sanitized in this pipeline, or does that happen later?
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.
Sanitization is the last step, anything we do here, will get sanitized at the end.
Note: since the parseMarkdown
is no longer used (helper method in the test, and post-markdown-rendering step in the lib/ code), removing it.
Co-authored-by: Sigurd Meldgaard <[email protected]>
Co-authored-by: Sigurd Meldgaard <[email protected]>
[]
around the version are removedv
before the version is removed (fixes Show versions in changelog consistently #7395)yyyy-MM-dd
, it may beyyyy/MM/dd
in the source-
from the version (optional in the source)