- Issue created by @ronald-garcia
- Status changed to Postponed: needs info
9 months ago 6:42pm 10 April 2024 I don't see a difference between the two code blocks, and no CDATA in them, or I am missing the point. Can you explain in a little more detail to correct my misunderstanding, or, update the code blocks?
This issue is written as if the behavior is a regression. When and in what version of Drupal was it different?
Thanks in advance for the updates. 👋
- 🇺🇸United States ronald-garcia
I went ahead and updated the code blocks, sorry for the confusion.
Note also when viewing in a list view in 10.1 the style tags is shown as /**/, whereas now in 10.2 the inline CSS style displays instead. Like below:.testing { background-color: #FFC; border: thin solid #CCC; padding: 10px; width:90%; margin-left:5%; margin-right:5% }
Testing 123 data.When viewing the node itself, if you inspect the text above it you'll see the inline
There is not an
html.php
in Drupal. What ishtml.php
referring-to in the issue title?Did you look over the Drupal 10.2.0 release notes → ? This seems an intentional change in HTML utility classes → .
- Merge request !7431Issue #3440034 cdata not generated in node for inline styles. → (Open) created by Unnamed author
- 🇺🇸United States ronald-garcia
I thought so as well initially after reading the release notes.
After further debugging, notice in my MR, that I have only made two lines of updates and it should fixed this issue.
This fix will still also go thru the intentional changed in HTML utility though, it's before the serializing of the body using the custom set of rules in
\Masterminds\HTML5::saveHTML() process.The Html.php is located in core/lib/Drupal/Component/Utility/Html.php.
- 🇺🇸United States ronald-garcia
ron-g → changed the visibility of the branch 3440034-cdata-is-not to hidden.
- 🇺🇸United States ronald-garcia
ron-g → changed the visibility of the branch 3440034-cdata-is-not to active.
- 🇺🇸United States ronald-garcia
ron-g → changed the visibility of the branch 3440034-cdata-is-not to hidden.
- 🇺🇸United States nicxvan
Please test this again on the most current 10.2.5 Someone mentioned a similar regression on this issue: https://www.drupal.org/project/drupal/issues/3433#comment-15527161 🐛 Use CDATA in XML RSS Feeds Fixed but mentioned it started working again on 10.2.4
- 🇺🇸United States ronald-garcia
Yes, with a capital "H", pls lemme know if you were able to replicate the issue.
- 🇬🇧United Kingdom longwave UK
CDATA was required by XHTML, but the web is now HTML5 and CDATA is no longer required: https://stackoverflow.com/questions/3302648/should-i-use-cdata-in-html5
In Drupal 10.2 we switched from using XHTML parsing and filtering to HTML5. However it appears that in this case the contents of a style tag was previously hidden by the CDATA wrapper, where the style tag itself was stripped presumably by text filters.
What is your text format configuration? Perhaps we need to adjust one of the filters to also remove the contents of style tags (and probably script tags as well).
- 🇳🇿New Zealand quietone
Changes are made on on 11.x (our main development branch) first, and are then back ported as needed according to our policies.