- Merge request !3106Issue #3017548: "Filtered HTML" text format does not support manual teaser break (<!--break-->) โ (Open) created by smustgrave
- First commit to issue fork.
- ๐บ๐ธUnited States alison
Rebased; tests are running.
I wonder if we should update the issue title and description to "Basic HTML" instead of "Filtered HTML", based on what comes with recent versions of Drupal?
-------
Meanwhile, I tried to review the changes in DrupalPod, so far, I don't seem to be able to add<!-- break -->
to a WYSIWYG-enabled text area and have it be preserved, but I might be testing wrong -- am I meant to create a text format called filtered_html?The only config change I tried so far was to add
<!-- break -->
toeditor[settings][plugins][ckeditor5_sourceEditing]
[allowed_tags], but this change didn't "stick" (when I went back into the basic_html config form, the break tag wasn't there anymore). ANYWAY, I'm probably just not testing right -- maybe worth adding test instructions to the issue summary? - Status changed to Needs work
about 2 years ago 8:22pm 17 February 2023 - ๐บ๐ธUnited States smustgrave
Self review.
Will have to retake a look at this. Title could be updated and something may have to be tweaked as it longer appears to be working. Could use an issue summary update.
- ๐จ๐ญSwitzerland stefanos.petrakis@gmail.com Biel, Switzerland
Regarding #52: The provided solution is only effective for non-WYSIWYG editing. CKEditor 5 is by default removing any html comments so the reported issue will be caused by the editor and not Drupal's text formats. More on this here =>
https://ckeditor.com/docs/ckeditor5/latest/features/general-html-support...
That being said, if you would pick e.g. the RestrictedHTML format when editing which doesn't use an editor, you could test the provided solution.In general, even if a solution is presented for CKEditor (e.g. sth similar to https://ckeditor.com/docs/ckeditor5/latest/features/html-embed.html), the existing solution will still be necessary to tackle this issue.
This issue may need to change into a task, e.g. "Support manual summary delimiter breaks", where 2 problems will be addressed:
- FilterHTML's support for the delimiter (already has a solution)
- CKEditor5's support for the delimiter (as in a CKEditor Plugin that would preserve this html comment). That was also suggested in #40
- ๐ฉ๐ฐDenmark ressa Copenhagen
@alison: It's
<!--break-->
, not<!-- break -->
. I tried both, and only<!--break-->
works :)I can confirm that the "Full HTML" text format cuts off the text after
<!--break-->
, both in node display, as well as in a view. - ๐ฉ๐ฐDenmark ressa Copenhagen
I wonder if we should update the issue title and description to "Basic HTML" instead of "Filtered HTML", based on what comes with recent versions of Drupal?
Great idea, I updated to that.
For those upgrading from older versions of Drupal, it is also true that it doesn't work for "Filtered HTML" either.
Is this issue still being worked on? The last update re code is from a year ago, and I do not see any issue regarding the CKE5 issue mentioned in #56.
- ๐ญ๐บHungary Gรกbor Hojtsy Hungary
Gรกbor Hojtsy โ made their first commit to this issueโs fork.
- ๐ญ๐บHungary Gรกbor Hojtsy Hungary
I think its fine to fix the backend processing in this issue and solve the CKEditor problem in another issue. I changed the target branch of the MR to 11.x where it should be, but there are conflicts that need resolving. Hope someone can pick that up? :) In general I think the diff looks reasonable BTW.
- ๐ญ๐บHungary Gรกbor Hojtsy Hungary
BTW https://www.drupal.org/project/ckeditor_drupalbreaks โ is a contributed project that provides a UI to add the break as well as a filter to preserve the break.
- Assigned to Anita verma
- ๐จ๐ฆCanada phjou Vancouver ๐จ๐ฆ ๐ช๐บ
Just discovered that the site I was using had that patch and broke the upgrade when switching to Ckeditor5. AFter removing the patch it was working, but I guess I lose the feature.
Thanks @Gabor for the suggestion of the module, it already installed on my site, I'll try the new branch.
Do you know if we need the patch + the module or is the module enough? - First commit to issue fork.
- ๐ฉ๐ชGermany Harlor Berlin
I created a new MR based on 11.x with the diff from MR 3106.
- ๐ฉ๐ชGermany Harlor Berlin
I'm not sure if the test failures have anything todo with the changes in this issue. I hope someone finds time to find this out.
- ๐ฉ๐ชGermany Harlor Berlin
Ah OK the tests did pass at a rerun now.
Back to needs review.
- ๐บ๐ธUnited States smustgrave
Gave a light review but was previously tagged for an issue summary update which will be needed.
- ๐บ๐ธUnited States mradcliffe USA
I performed Novice Triage on this issue. I am leaving the Novice tag on this issue based on @smustgrave's triage. We should focus on the issue summary update based on recent work and resolving the code review.
- ๐บ๐ธUnited States mr. libby Boston
Issue Summary
I tested the BREAK functionality in Drupal 11 using the latest patch from the 3017548-d11 branch with @jeff chicoine. The expected behavior is that content before BREAK should appear in the teaser view, while the full content should be visible in the full node view. However, my testing indicates that
<!--break-->is not working as expected.
Steps to Reproduce
1.) Set up a Drupal 11 environment using DDEV and Composer.
2.) Checked out the 3017548-d11 branch and pulled the latest changes.
3.) Created a new content type: Testing Text WYSIWYG.
Added two fields:
Basic Formatted w/ Summary (Basic HTML text format)
Full Formatted w/ Summary (Full HTML text format)
4.) Configured the Manage Display settings:
Both fields are set to show in Teaser and Full content display modes.
Teaser display mode set to "Trimmed or Summary".
5.) Created new content using this content type.
Added two paragraphs of text in both fields.
Inserted BREAK between the paragraphs.
6.) Viewed the node in both Full content and Teaser view.
Observed Behavior
In Full view, both paragraphs appear as expected.
In Teaser view, the entire content is still displayed instead of stopping at BREAK.
The behavior is the same for both "Basic HTML" and "Full HTML" fields.
Expected Behavior
The Teaser view should display only the text before BREAK, but currently, it does not.
Possible Causes / Next Steps
It seems that BREAK is not being processed correctly when rendering teaser content.
This could be due to text filtering stripping out comments or incorrect processing in the teaser rendering logic.
Further investigation is needed to confirm where BREAK is being ignored.
Note: the break tag was written correctly for the test, but when trying to describe it here break was working correctly and ruining my comment. : )