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

Problem with El's text #31

Closed
magdaddy opened this issue Jan 26, 2019 · 3 comments
Labels
bug

Comments

@magdaddy
Copy link

@magdaddy magdaddy commented Jan 26, 2019

Thank you David for your awesome work! I'm very new to Rust and Seed is the only frontend framework I find accessible.

But I discovered a problem. If I put multiple text nodes in an El, only the last one survives.

An example:
p![ "Today it's ", em!["not"], " gonna rain, this ", em!["is"], " so ", strong![ "good!" ] ]
becomes
<p> so <em>not</em><em>is</em><strong>good!</strong></p>

I suppose it's because the text in the El-struct is Option<String>. Maybe we need Vec<String>. But then it's still not clear where which text should go. Maybe it's best to have a special "Text"-Node that can go in the children-Vec.
For now we can work around this e.g. wrapping the text in <span> tags.
When I have a better understanding of the codebase I try to contribute a fix, but as I said, I'm very new to Rust.

@David-OConnor David-OConnor added the bug label Jan 26, 2019
@David-OConnor

This comment has been minimized.

Copy link
Member

@David-OConnor David-OConnor commented Jan 26, 2019

This is caused by me not recognizing the need for more than one. As you've observed, El doesn't store more than one.

I think we need to include this with Children somehow, to preserve order in cases like yours.

@David-OConnor

This comment has been minimized.

Copy link
Member

@David-OConnor David-OConnor commented Jan 26, 2019

Fixed in latest commit.

@magdaddy

This comment has been minimized.

Copy link
Author

@magdaddy magdaddy commented Jan 26, 2019

Thanks for fixing this so quickly, works perfectly now!

@magdaddy magdaddy closed this Jan 26, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.