-
Notifications
You must be signed in to change notification settings - Fork 738
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
Markdown
improvements
#2803
Merged
Merged
Markdown
improvements
#2803
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
Noting too crazy or clever to start with, initially something to just test the basics and to ensure that the resulting Textual node list is what we'd expect. Really just the start of a testing framework for Markdown.
This allow for a couple of things: 1. First and foremost this will let me test for unhandled tokens in testing. 2. This will also let applications support other token types.
I believe this should be a fine way to solve this. I don't see anything that means that a `code_block` is in any way different than a fenced block that has no syntax specified. See Textualize#2781.
See Textualize#2676 Co-authored-by: TomJGooding <101601846+TomJGooding@users.noreply.github.com>
Also add a test for the list inline code block
willmcgugan
reviewed
Jun 19, 2023
willmcgugan
approved these changes
Jun 20, 2023
This was referenced Jun 21, 2023
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.
A small selection of
Markdown
QoL changes and fixes, including:unhandled_token
method, which inMarkdown
itself is a no-op (giving the effect of what happened before this was added), but also lets anyone inherit fromMarkdown
and handle other MarkdownIT tokens -- possibly those added via extensions that aren't included in core Textual. This is also useful for testing purposes too as the method can be overridden to raise an error rather than ignore unknown tokens.MarkdownBlock
fromtextual.widgets.markdown
; pretty necessary for anyone wanting to use the above1.Markdown
-specific unit testing. Just the basics for now, but this at least provides some baseline tests and also a framework for further testing.Markdown
: Sections missing in the rendering #2781 (code blocks not appearing; not to be confused with fenced blocks).Markdown
widget: Code blocks in lists are incorrectly ordered, sometimes don't appear #2676.Markdown
widget: Code blocks in lists are incorrectly ordered, sometimes don't appear #2676 -- ensuring that code blocks in lists are rendered inline.Markdown
can receive focus #2380Footnotes
I am thinking it might be a good idea to export all the major Markdown widgets in this way. ↩