malcommac / SwiftRichString

👩‍🎨 Elegant Attributed String composition in Swift sauce
MIT License
3.1k stars 211 forks source link

How to not apply parent tag's style to child ones? #137

Open abayken opened 2 years ago

abayken commented 2 years ago

I have following html:

    <li> Some item <strong>here</strong></li> 

    I add style to li tag to give them bullet points:

    let li = Style {
                $0.textTransforms = [
                    TextTransform.custom {
                        return "• " + $0
                    }
                ]
            }

    Because of li is the parent for tags inside of it, that text transformation is also applying to strong tag. So my strong tag having a bullet point. How to avoid it?