Skip to content
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

Add supporting <h1> to <h6> Tags #301

Open
GimazDo opened this issue Jul 7, 2024 · 1 comment
Open

Add supporting <h1> to <h6> Tags #301

GimazDo opened this issue Jul 7, 2024 · 1 comment

Comments

@GimazDo
Copy link

GimazDo commented Jul 7, 2024

At the moment I have only found support for inserting html code into richState. Is there any plan to support changing the current paragraph style?
Like
state.toggleParagraphStyle( style = Header1 )

@MohamedRejeb
Copy link
Owner

MohamedRejeb commented Jul 10, 2024

Hi,
In Compose we have SpanStyle so you after parsing HTML, h1 to h6 tags are converted to SpanStyle.
Here's the SpanStyle for each tag, you can copy this code and use it in your project:

internal val H1SPanStyle = SpanStyle(fontSize = 2.em, fontWeight = FontWeight.Bold)

internal val H1SpanStyle = SpanStyle(fontSize = 2.em, fontWeight = FontWeight.Bold)

state.toggleSpanStyle(H1SpanStyle)

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

No branches or pull requests

2 participants