- Issue created by @Laurie Lim
I'm working on a decoupled project and we use JSON:API. The processed output is wrapped in a body tag as follows:
body: {
value: "<p>This is a paragraph</p><embedded-content data-plugin-config="{"url":"https:\/\/www.drupal.org\/project\/ckeditor5_embedded_content","text":"Find out more"}" data-plugin-id="call_to_action"> </embedded-content><p>This is another paragraph after the embedded content.</p>",
format: "full_html",
processed: "<p>This is a paragraph</p><body><p>
<a href="https://www.drupal.org/project/ckeditor5_embedded_content" style="background:blue;color:white;border-radius: 1rem;font-size: 2rem;padding:1rem">
Find out more
</a>
</p>
</body><p>This is another paragraph after the embedded content.</p>",
summary: ""
},
I'm guessing that usually, the extra body tag gets removed automatically because there can only be 1 body tag per page but since the JSON output is just a string, then the body tag remains.
<body>
From what I understand in
issue #3364980 →
src/Plugin/Filter/EmbeddedContent.php was updated and the line $new_node = $document->importNode($xpath->query('//body')->item(0), TRUE);
is querying the body tag. Ideally the content inside the body should be returned instead.
Active
1.0
Code