Skip to content
Snippets Groups Projects

Add html to custom element Sanitizer and custom element to html normalizer

3 unresolved threads

Closes #3494426

Merge request reports

Members who can merge are allowed to add commits.
Approval is optional
Code Quality is loading
Test summary results are being parsed
Ready to merge by members who can write to the target branch.
  • The source branch is 13 commits behind the target branch.
  • 1 commit will be added to 3.x.
  • Source branch will not be deleted.

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
  • Roderik Muit requested changes

    requested changes

  • added 1 commit

    Compare with previous version

  • added 1 commit

    Compare with previous version

  • added 1 commit

    Compare with previous version

  • added 1 commit

    • 7482dce2 - remove unneccessary html5 DI

    Compare with previous version

  • Mustapha Ben Ellafi resolved all threads

    resolved all threads

  • 25 */
    26 public function __construct() {
    27 $this->html5Parser = new HTML5();
    28 }
    29
    30 /**
    31 * Converts HTML content to a CustomElement tree structure.
    32 *
    33 * @param string $htmlContent
    34 * The HTML content to convert.
    35 *
    36 * @return \Drupal\custom_elements\CustomElement|null
    37 * Returns the root CustomElement or NULL if conversion fails.
    38 */
    39 public function convertHtmlToCustomElement(string $htmlContent): ?CustomElement {
    40 $dom = $this->html5Parser->loadHTML($htmlContent);
  • 7 7 use Symfony\Component\Serializer\Normalizer\NormalizerInterface;
    8 8
    9 9 /**
    10 * Formats a custom element structure into an array.
    10 * Formats a custom element structure into an array or HTML string.
    • I don't see why we are changing/extending the purpose of this class. Rendering custom_elements to html markup works via the drupal render system and I don't see why this issue requires us to change it.

      We can and maybe should mention this in the class docblock comment here though + clearly document which "format" is supported

    • Please register or sign in to reply
  • 30 */
    31 protected static $modules = ['custom_elements'];
    32
    33 /**
    34 * {@inheritdoc}
    35 */
    36 protected function setUp(): void {
    37 parent::setUp();
    38 $this->htmlParser = $this->container->get('custom_elements.html_parser');
    39 $this->normalizer = $this->container->get('custom_elements.normalizer');
    40 }
    41
    42 /**
    43 * Tests converting HTML content to custom elements and back.
    44 */
    45 public function testHtmlToCustomElementAndBack() {
  • Wolfgang Ziegler requested changes

    requested changes

  • Please register or sign in to reply
    Loading