Skip to content

Rust: expose public StyledText markdown parsing API#11180

Open
amirHdev wants to merge 2 commits intoslint-ui:masterfrom
amirHdev:feat-rust-styled-text-markdown-api
Open

Rust: expose public StyledText markdown parsing API#11180
amirHdev wants to merge 2 commits intoslint-ui:masterfrom
amirHdev:feat-rust-styled-text-markdown-api

Conversation

@amirHdev
Copy link
Copy Markdown
Contributor

This adds the missing public Rust API for creating StyledText values in
application code and passing them to styled-text properties.

Fixes #11158

Tests:

  • cargo fmt --all
  • cargo test -p slint --test styled_text

…vel blank lines

Signed-off-by: Amirhossein Akhlaghpour <m9.akhlaghpoor@gmail.com>
Add a public Rust API to create StyledText values from markdown or plain
text so application code can assign them to styled-text properties.

- re-export StyledText and StyledTextError from the public slint crate
- add parse_markdown(), parse_markdown_with_arguments(), and
  string_to_styled_text()
- add StyledText::from_plain_text() and StyledText::parse()
- add a Rust regression test covering markdown and plain-text assignment
- document the styled-text Rust type mapping

Fixes slint-ui#11158
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.

Styled text: Add API in Rust/C++/etc. to feed markdown into Slint

1 participant