dasautoooo / Parma

A SwiftUI view for displaying Markdown with customizable appearances.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

plainText(_ text: String) overrides heading settings. Is that working the way its meant to?

bryan1anderson opened this issue · comments

I have some markdown text like this:

This is my title

And this is my body

And when I use the plaintText(_ text: String) to provide a font for the plain body text, it overrides the header font changes value and forces all text from the entire string an displays it with the same font

I think essentially I can't apply a font to the body without overriding all headers. Foreground color seems to override as well.

This is kind of a bummer for me. I'd be happy to help make some commits to improve this functionality but would greatly appreciate a little bit of direction before I dive into it

Hi @bryan1anderson ,

The plaintText(_ text: String) method is the basic building block of all text-based elements, so the changes to this will eventually affect all text components. It is suggest that apply you custom behavior to the specific element; for example, if you want to change the header font, just apply the font modifier to the header block delegate method.

Foreground color seems to override as well.

Can you explain this in depth?

Thanks anyway!

I wanted to apply a font to the body.
For now this works:

                        Parma(markdown, render: ListRender())
                            .font(footnoteFont)