Fixing errors in client

This commit is contained in:
Chris Troutner
2026-09-18 08:52:19 -07:00
parent 4c6d20fefc
commit f4e40a9dcd
3 changed files with 9 additions and 3 deletions
@@ -71,7 +71,7 @@ function PostContent ({ text = '', initialFailedImages }) {
React.createElement('iframe', { React.createElement('iframe', {
src: `${YOUTUBE_EMBED_BASE_URL}/${segment.videoId}`, src: `${YOUTUBE_EMBED_BASE_URL}/${segment.videoId}`,
title: `YouTube video ${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', referrerPolicy: 'strict-origin-when-cross-origin',
allowFullScreen: true, allowFullScreen: true,
frameBorder: '0' frameBorder: '0'
@@ -137,7 +137,7 @@ function PostFeedItem ({
</header> </header>
<div className='posts-feed-item-content'> <div className='posts-feed-item-content'>
<p className='posts-feed-item-text'> <div className='posts-feed-item-text'>
<Link <Link
to={`/profile/${encodeURIComponent(post.addr)}`} to={`/profile/${encodeURIComponent(post.addr)}`}
className='posts-feed-item-inline-author' className='posts-feed-item-inline-author'
@@ -148,7 +148,7 @@ function PostFeedItem ({
{' '} {' '}
<PostContent text={post.text} /> <PostContent text={post.text} />
</p> </div>
</div> </div>
{(showReplyCount || showLikeButton) && ( {(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"/) 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', () => { 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?') 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/) assert.match(html, /<a[^>]+href="https:\/\/i\.imgur\.com\/swCI56T\.jpeg"[^>]*>[\s\S]*<img/)