Repository navigation
feat: let mods show html in a markdown TextView as text with raw_html(false) - #1073
Open
aetoskevin wants to merge 1 commit into
Open
aetoskevin wants to merge 1 commit into
aetoskevin wants to merge 1 commit into
Conversation
This branch has not been deployed
This file contains hidden or 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
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.
Fixes #1071.
A mod can now write
TextView.markdown(id, text).raw_html(false)to show any HTML in the Markdown as the text it is written as. Autolinks stay links, and the default is unchanged.vendor/gpui-kit/crates/base: backports gpui-kit text: Add an option to keep raw HTML in Markdown as text longbridge/gpui-kit#3979 (MarkdownExtensions::raw_html,TextView::markdown_raw_htmland its test), markedHERDR:. It's reviewed there and not yet merged; once herdr-app's vendored gpui-kit includes it, this backport goes away.vendor/gpui-kit/crates/shell:raw_htmlbehavior, registered whereselectableandscrollableare;markdown_raw_htmlwhen theTextViewis built;TextViewElementin the generated.d.ts.defaults/AGENTS.md: one line on.raw_html(false).Tests:
raw_html(is declared onTextViewElementonly;:raw_html);How it was tested (macOS 26.6.2 ARM64), running the vendored crates' tests resolved through Herdr's
Cargo.lockand patches:README.md, which a test reads withinclude_str!and which isn't vendored, so I put it in place for the run.text_viewand typings tests pass.typings::tests::every_element_method_is_accounted_for(3208 declared style methods against 3207 in the runtime's table).cargo test --lockedpasses (Rust 1.100.0, Zig 0.16.0). It doesn't run the vendored crates' tests, because the workspace excludesvendor/gpui-kit; hence the runs above.Written with AI (Claude).