umbraco / Umbraco-CMS

Umbraco is a free and open source .NET content management system helping you deliver delightful digital experiences.
https://umbraco.com
MIT License
4.45k stars 2.68k forks source link

RTE styles stripped in BlockGrid Views #14403

Open craigs100 opened 1 year ago

craigs100 commented 1 year ago

Which Umbraco version are you using? (Please write the exact version, example: 10.1.0)

11.2.2

Bug summary

When trying to align text or adding any inline styles to RTE content they are stripped out when viewed in a BlockGrid view

Specifics

The RTE Slide out shows the correct style, the front end web page shows the correct style yet the view used in the back office BlockGrid strips out the inline styles completely.

Back office slide out editor image

Back office BlockGrid view image

Web page image

As you can see the formatting is not there for the BlockGrid view. This is also the case on the Umbraco BlockGrid Demo site.

Steps to reproduce

  1. Create an RTE BlockGrid iaw the docs. Also create a back office view for the BlockGrid.
  2. Use the RTE block in a page's BlockGrid and edit it's content.
  3. Using the RTE toolbar, or manually, set some text to align center and submit the change. Note the text in the BlockGrid view is still left aligned.
  4. Save and publish the page and/or save and preview, either way, view the web page and notice the text added is centre aligned.

Expected result / actual result

Expected the Block Grid RTE to faithfully reflect the edited content

What happened was the RTE content was stripped of all inline styles in the BlockGrid view.

github-actions[bot] commented 1 year ago

Hi there @craigs100!

Firstly, a big thank you for raising this issue. Every piece of feedback we receive helps us to make Umbraco better.

We really appreciate your patience while we wait for our team to have a look at this but we wanted to let you know that we see this and share with you the plan for what comes next.

We wish we could work with everyone directly and assess your issue immediately but we're in the fortunate position of having lots of contributions to work with and only a few humans who are able to do it. We are making progress though and in the meantime, we will keep you in the loop and let you know when we have any questions.

Thanks, from your friendly Umbraco GitHub bot :robot: :slightly_smiling_face:

andr317c commented 1 year ago

Hey!

Thanks for posting the issue 😄. I was able to reproduce this issue on v10.5.1, 11.4.0 and 12.0.0-rc3. I will mark it as an up for grabs.

A gif of the issue: RTEStyles

github-actions[bot] commented 1 year ago

Hi @craigs100,

We're writing to let you know that we would love some help with this issue. We feel that this issue is ideal to flag for a community member to work on it. Once flagged here, folk looking for issues to work on will know to look at yours. Of course, please feel free work on this yourself ;-). If there are any changes to this status, we'll be sure to let you know.

For more information about issues and states, have a look at this blog post.

Thanks muchly, from your friendly Umbraco GitHub bot :-)

kasparboelkjeldsen commented 1 year ago

Working on this - seems to be the default sanitization of angular removing the style tags created in the rich text.