mirror of
https://github.com/Athou/commafeed.git
synced 2026-11-20 02:33:33 +00:00
fix youtube embeds (#2394)
This commit is contained in:
@@ -106,7 +106,14 @@ const Content = React.memo((props: ContentProps) => {
|
|||||||
return (
|
return (
|
||||||
<BasicHtmlStyles>
|
<BasicHtmlStyles>
|
||||||
<Box className={classes.content}>
|
<Box className={classes.content}>
|
||||||
<Interweave content={props.content} transform={transform} matchers={matchers} allowList={allowList} />
|
<Interweave
|
||||||
|
content={props.content}
|
||||||
|
transform={transform}
|
||||||
|
matchers={matchers}
|
||||||
|
allowList={allowList}
|
||||||
|
// attributes are already sanitized server-side
|
||||||
|
allowAttributes
|
||||||
|
/>
|
||||||
</Box>
|
</Box>
|
||||||
</BasicHtmlStyles>
|
</BasicHtmlStyles>
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -140,6 +140,7 @@ public class FeedEntryContentCleaningService {
|
|||||||
|
|
||||||
whitelist.addEnforcedAttribute("a", "target", "_blank");
|
whitelist.addEnforcedAttribute("a", "target", "_blank");
|
||||||
whitelist.addEnforcedAttribute("a", "rel", "noreferrer");
|
whitelist.addEnforcedAttribute("a", "rel", "noreferrer");
|
||||||
|
whitelist.addEnforcedAttribute("iframe", "referrerpolicy", "strict-origin-when-cross-origin");
|
||||||
return whitelist;
|
return whitelist;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ class FeedEntryContentCleaningServiceTest {
|
|||||||
<p>
|
<p>
|
||||||
Some text
|
Some text
|
||||||
<img width="965" height="320" src="https://localhost/an-image.png" alt="alt-desc" style="width:100%;">
|
<img width="965" height="320" src="https://localhost/an-image.png" alt="alt-desc" style="width:100%;">
|
||||||
<iframe src="https://localhost/an-iframe" style="width:100%;"></iframe>
|
<iframe src="https://localhost/an-iframe" style="width:100%;" referrerpolicy="strict-origin-when-cross-origin"></iframe>
|
||||||
aaa
|
aaa
|
||||||
</p>
|
</p>
|
||||||
"""
|
"""
|
||||||
|
|||||||
Reference in New Issue
Block a user