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

Paragraph block: inline styling for mark elements stripped out #48536

Closed
KokkieH opened this issue Dec 22, 2020 · 6 comments
Closed

Paragraph block: inline styling for mark elements stripped out #48536

KokkieH opened this issue Dec 22, 2020 · 6 comments
Labels
[Type] Enhancement Changes to an existing feature — removing, adding, or changing parts of it

Comments

@KokkieH
Copy link
Contributor

KokkieH commented Dec 22, 2020

Steps to reproduce

  1. Create a post
  2. Type some text in a paragraph block
  3. Edit block as HTML, and wrap some text in <mark></mark> tags.
  4. Add a style attribute and set a custom background color
    Example: <p>This is <mark style="background-color:red;">some</mark> text</p>
  5. View published post
  6. Leave the editor and then open the post again for editing, and check HTML

What I expected

For the text to be highlighted in the custom color I'd added in the style attribute.

What happened instead

On the published post the text is highlighted in the default yellow color based on the browser's built-in styles

On leaving the editor and reopening it, the style attribute has been stripped from the mark element.

This issue appears to be specific to WordPress.com - on a self-hosted WordPress site this works as expected, so I'm guessing this might have to do with the safe-list we maintain for what HTML tags and attributes can be used on WordPress.com, rather than an issue with the editor itself, so this is more of an enhancement request than a bug report - until text highlighting is natively added in the block editor, can we at least ensure that WordPress.com site owners can use all the HTML tags and attributes that allow them to do this manually?

Context / Source

Discovered while testing a solution for a user question in https://wordpress.com/forums/topic/redacting-text/.

@KokkieH KokkieH added [Type] Enhancement Changes to an existing feature — removing, adding, or changing parts of it Involves Happiness labels Dec 22, 2020
@github-actions
Copy link

This issue is stale because it has been 180 days with no activity. You can keep the issue open by adding a comment. If you do, please provide additional context and explain why you’d like it to remain open. You can also close the issue yourself — if you do, please add a brief explanation and apply one of relevant issue close labels.

@inaikem
Copy link
Contributor

inaikem commented Sep 23, 2021

Scrubbed request. I have confirmed the style attribute is removed on Simple sites but retained on Atomic and self-hosted sites.

I expect this is intentional - especially on Simple site plans which don't permit custom CSS.

@simison, can you see the use of style in the code editor ever making it to Simple sites?

@simison
Copy link
Member

simison commented Sep 23, 2021

Yes, we will need this for WordPress/gutenberg#34680

I gave Team Calypso heads up earlier this week. Cc @fullofcaffeine

@inaikem
Copy link
Contributor

inaikem commented Sep 23, 2021

Thank you!

@KokkieH
Copy link
Contributor Author

KokkieH commented Sep 23, 2021

@inaikem

I expect this is intentional - especially on Simple site plans which don't permit custom CSS.

We've never blocked the use of inline styles on free sites, and it works for, e.g. <span></span> tags.

@KokkieH
Copy link
Contributor Author

KokkieH commented Oct 28, 2021

This has been fixed in D68544-code (also related to #57036), so closing this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Type] Enhancement Changes to an existing feature — removing, adding, or changing parts of it
Projects
None yet
Development

No branches or pull requests

3 participants