Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Replace the "Limit allowed HTML tags" and "Correct faulty and chopped off markup" filters with versions that are HTML5 aware.
This is needed for modules that are using, for instance, user-defined attributes (data-whatever) or HTML5 tags. embed_external needs this, and I'm sure other modules could use it as well.
Comment | File | Size | Author |
---|---|---|---|
#8 | replace_core_text-2415305-8.patch | 22.48 KB | natew |
#7 | replace_core_text-2415305-7.patch | 23.17 KB | sylus |
#5 | replace_core_text-2415305-5.patch | 22.49 KB | sylus |
#1 | 2415305_01.patch | 21.77 KB | cweagans |
Comments
Comment #1
cweagansComment #2
joseph.olstadGreat work Cweagans, I had a quick look at the patch, it's using the masterminds html5 library, this is good. I'm assuming that we install the masterminds library into sites/all/libraries ?
I'll try to have a closer look at this patch next week and try it out.
Thanks again for the hard work and for sharing! So happy :)
Comment #3
cweagansYeah, it should live in sites/all/library/html5-php.
Note that the unit test for this removes the XHTML test cases and CDATA-related things. I also added tests for checking html5 tags and user-defined attributes.
Comment #4
Dave ReidBecause this constitutes such a large change to the behaviors of filters, I would propose this variable is disabled by default. Our site is using this patch and encountered several errors in the process due to xautoload and not finding the right html5-php library classes that we have yet to be able to resolve. It would be nice if this module didn't suddenly take over the entire filter system.
Comment #5
sylus CreditAttribution: sylus commentedI have made the minor change that Dave Reid requested which incidentally works well for me since am adding a custom patch to just make a whole new filter linked to a different text formatter. So can keep both alongside each other so can transition slowly.
This is now in Drupal 8 though am not sure whether there were concerns about html5-php not being a validating parser though I think there was mitigations.
Incidentally I did also have the xautoload + html5-php not being detected properly for a bit but some cache clears / debugging seemed to resolve it. Might be a race condition between xautoload and libraries_load?
Aside from that agreed thanks for the work!
Comment #6
dimaro CreditAttribution: dimaro at La Drupalera by Emergya commentedUpdate to run the tests.Upps sorry for this coment, wrong issue.
Comment #7
sylus CreditAttribution: sylus commentedI wanted instead of altering the default Drupal input filters to add two additional ones that could be used for a more phased approach. Attaching patch with minor addition of html5_tools_filter_info().
Comment #8
natew CreditAttribution: natew commentedRe-spin of #7 as I was running into issues applying this to 1.3