Body content removed when YouTube URL nested in element
-
Hi there,
I believe I’ve found a bug where all body content EXCEPT the date and the YouTube video is removed/overwritten if a YouTube (and maybe also Vimeo) URL is nested within another element, like a <div> or a <section> element, in the body content.
I’ve tested this on a clean WordPress (v6.0.3) site with only the Publish Apple News Plugin (v.2.3.3) installed.
On the working example, which you can preview in Apple News here, this is what I have in the text editor:
<p>Content above the video</p> <p>https://www.youtube.com/watch?v=ThiCMd5kGbE</p> <p>Content below the video</p>
This is components part of the JSON generated by the Apple News plugin:
"components": [ { "role": "title", "text": "Example post with YouTube", "format": "html", "textStyle": "default-title", "layout": "title-layout" }, { "role": "author", "text": "by Jane", "format": "html", "textStyle": "default-author", "layout": "author-layout" }, { "role": "body", "text": "Dec 12, 2022 | 9:53 AM", "textStyle": "default-date", "layout": "date-layout" }, { "role": "body", "text": "<p>Content above the video<\/p>", "format": "html", "textStyle": "dropcapBodyStyle", "layout": "body-layout" }, { "role": "embedwebvideo", "aspectRatio": 1.777, "URL": "https:\/\/www.youtube.com\/embed\/ThiCMd5kGbE", "layout": "embed-web-video-layout" }, { "role": "body", "text": "<p>Content below the video<\/p>", "format": "html", "textStyle": "default-body", "layout": "body-layout-last" }],
In the non-working example, which you can preview in Apple News here, this is what I have in the text editor:
<div> <p>Content above the video</p> <p>https://www.youtube.com/watch?v=ThiCMd5kGbE</p> <p>Content below the video</p> </div>
This is the component part of what is generated by the Apple News plugin:
"components": [ { "role": "title", "text": "Example post with YouTube nested in DOM", "format": "html", "textStyle": "default-title", "layout": "title-layout" }, { "role": "author", "text": "by Jane", "format": "html", "textStyle": "default-author", "layout": "author-layout" }, { "role": "body", "text": "Dec 7, 2022 | 11:56 AM", "textStyle": "default-date", "layout": "date-layout" }, { "role": "embedwebvideo", "aspectRatio": 1.777, "URL": "https:\/\/www.youtube.com\/embed\/ThiCMd5kGbE", "layout": "embed-web-video-layout" }],
As you can see, all content EXCEPT the date and the YouTube video is removed/overwritten if it’s nested within an element (in this case, a <div>).
Is anyone able to confirm:
1. If this is a bug/known issue?
2. You are able to replicate this same issue?
3. If there is work-around in the meantime that doesn’t involve editing the each article to remove any wrapping element(s)?Please let me know if I can provide any additional information.
Thanks,
Jane
- The topic ‘Body content removed when YouTube URL nested in element’ is closed to new replies.