mirror of
https://github.com/Permissionless-Software-Foundation/psf-memo.git
synced 2026-09-21 16:52:01 -07:00
Fixing errors in client
This commit is contained in:
@@ -71,7 +71,7 @@ function PostContent ({ text = '', initialFailedImages }) {
|
||||
React.createElement('iframe', {
|
||||
src: `${YOUTUBE_EMBED_BASE_URL}/${segment.videoId}`,
|
||||
title: `YouTube video ${segment.videoId}`,
|
||||
allow: 'accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share',
|
||||
allow: 'accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture',
|
||||
referrerPolicy: 'strict-origin-when-cross-origin',
|
||||
allowFullScreen: true,
|
||||
frameBorder: '0'
|
||||
|
||||
@@ -137,7 +137,7 @@ function PostFeedItem ({
|
||||
</header>
|
||||
|
||||
<div className='posts-feed-item-content'>
|
||||
<p className='posts-feed-item-text'>
|
||||
<div className='posts-feed-item-text'>
|
||||
<Link
|
||||
to={`/profile/${encodeURIComponent(post.addr)}`}
|
||||
className='posts-feed-item-inline-author'
|
||||
@@ -148,7 +148,7 @@ function PostFeedItem ({
|
||||
{' '}
|
||||
|
||||
<PostContent text={post.text} />
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{(showReplyCount || showLikeButton) && (
|
||||
|
||||
@@ -49,6 +49,12 @@ test('renders an embedded YouTube player and a separate link together', () => {
|
||||
assert.doesNotMatch(html, /<a[^>]+href="https:\/\/youtu\.be\/dQw4w9WgXcQ"/)
|
||||
})
|
||||
|
||||
test('YouTube iframe allow list omits unrecognized web-share', () => {
|
||||
const html = render('https://youtu.be/dQw4w9WgXcQ')
|
||||
assert.match(html, /<iframe[^>]+allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture"/)
|
||||
assert.doesNotMatch(html, /web-share/)
|
||||
})
|
||||
|
||||
test('renders an image URL as an inline image inside a new-tab anchor', () => {
|
||||
const html = render('https://i.imgur.com/swCI56T.jpeg Anong breed ng basil ito?')
|
||||
assert.match(html, /<a[^>]+href="https:\/\/i\.imgur\.com\/swCI56T\.jpeg"[^>]*>[\s\S]*<img/)
|
||||
|
||||
Reference in New Issue
Block a user