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

Float does not work properly on board description #5271

Closed
Gwenwyfar opened this issue Dec 24, 2018 · 8 comments
Closed

Float does not work properly on board description #5271

Gwenwyfar opened this issue Dec 24, 2018 · 8 comments
Milestone

Comments

@Gwenwyfar
Copy link
Contributor

Gwenwyfar commented Dec 24, 2018

Description

As I understand how this works, you should be able to add/remove tags to $context['description_allowed_tags'], however it seems float is being processed differently than other tags I tested.

I haven't seen if there are others that do the same, but if you allow it, and use [float] in the description, upon saving the tag will be removed from the description text, and float code will be added both to the description and the title.

Steps to reproduce

  1. Add float to allowed list of bbc, then save any board description with float in it.
@SychO9
Copy link
Contributor

SychO9 commented Dec 25, 2018

Actually, the problem here is that the description is inside a P tag, and the float converts to an html DIV tag, and <div tags can't go inside <p tags, so things go wild.

@Gwenwyfar
Copy link
Contributor Author

Hmm. Maybe it should be a span instead due to nesting possibilities then. But something is still awry with how it applies it. Also, tags that are not allowed are not removed from the description as happens here.

@SychO9
Copy link
Contributor

SychO9 commented Dec 25, 2018

But something is still awry with how it applies it

hmm you're right, I just noticed while trying to edit the description that the float bbcode was gone (even though it's set as allowed)

Also, tags that are not allowed are not removed from the description as happens here.

well if they're not allowed, they're just interpreted as normal text so I don't think they should be removed, just not parsed

However we definitely need to change the description to a div element instead of paragraph, just tested a bunch of allowed bbc and it's gone really wild.

@Gwenwyfar
Copy link
Contributor Author

Gwenwyfar commented Dec 25, 2018

There's at least three (or more) issues here then.

1 - Description should be a div (we also allow divs in the description so there's that too)
2 - Float should be a span
3 - Float bbc gets edited out of the description
4 - Float bbc is applied twice where it shouldn't

@SychO9
Copy link
Contributor

SychO9 commented Dec 25, 2018

4 - Float bbc is applied twice where it shouldn't

if by twice you mean it going in the title & the description, this commit of PR #5003 fixes that
8101d65

@Sesquipedalian Sesquipedalian added this to the RC2 milestone Dec 25, 2018
@Sesquipedalian
Copy link
Member

1 - Description should be a div (we also allow divs in the description so there's that too)

Yes. The same can be said of quite a few other places cases a <p> appears in our templates. Not only can using <p> in such cases introduce problems like this, but moreover in most of them <p> is semantically incorrect.

2 - Float should be a span

No. Floats can contain other block level elements, so that's not an option.

@Gwenwyfar
Copy link
Contributor Author

2 - Ah yes, you're right. I'm slow today :P

@Sesquipedalian
Copy link
Member

No worries. That's why we help each other out, right?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants