Skip to content

Commit 9adde74

Browse files
committed
fix codepen inputs
1 parent 6c6d41b commit 9adde74

3 files changed

Lines changed: 20 additions & 25 deletions

File tree

‎frontend/main/src/components/notion-custom-blocks/CodeHighlight.tsx‎

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,12 @@ const CodeHighlight = ({
7272
{({ className, style, tokens, getLineProps, getTokenProps }) => (
7373
<pre
7474
className={`${className} whitespace-pre-wrap grid`}
75-
style={{ ...style, padding: '2rem', position: 'relative' }}
75+
style={{
76+
...style,
77+
padding: '2rem',
78+
position: 'relative',
79+
wordBreak: 'break-all',
80+
}}
7681
>
7782
<Button
7883
onClick={() => {

‎frontend/main/src/components/notion-custom-blocks/Embed.tsx‎

Lines changed: 13 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -29,34 +29,24 @@ const Embed = ({ config }: { config: WithContentValidationProps }) => {
2929
);
3030
}
3131
if (url.includes('codepen')) {
32+
console.log(url);
3233
return (
3334
<>
34-
<Script src="https://cpwebassets.codepen.io/assets/embed/ei.js"></Script>
35-
<p
36-
className="codepen"
37-
data-height="600px"
38-
data-default-tab="css,result"
39-
data-slug-hash={url.split('/').at(-1)}
40-
data-preview="true"
41-
data-user="codercatdev"
35+
<iframe
4236
style={{
43-
height: 600,
44-
boxSizing: 'border-box',
45-
display: 'flex',
46-
alignItems: 'center',
47-
justifyContent: 'center',
48-
border: '2px solid',
49-
margin: '1em 0',
50-
padding: '1em',
37+
width: '100%',
38+
height: '100%',
39+
backgroundColor: 'transparent',
5140
}}
41+
scrolling="no"
42+
title="Codepen"
43+
src={url.replace('/pen/', '/full/')}
44+
frameBorder="no"
45+
loading="lazy"
46+
allowFullScreen={true}
5247
>
53-
<span>
54-
See the Pen <a href={url}>Material Checkbox without Material</a> by
55-
Alex Patterson (
56-
<a href="https://codepen.io/codercatdev">@codercatdev</a>) on{' '}
57-
<a href="https://codepen.io">CodePen</a>.
58-
</span>
59-
</p>
48+
<a href={url.replace('/pen/', '/full/')}>See the Pen</a>
49+
</iframe>
6050
</>
6151
);
6252
}

‎frontend/main/src/layout/PostLayout.tsx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -454,7 +454,7 @@ export default function PostLayout({
454454
</section>
455455
</div>
456456
<>
457-
<div className="inline-block w-full m-4 xl:m-0 xl:hidden">
457+
<div className="inline-block w-full xl:m-0 xl:hidden">
458458
{recents()}
459459
</div>
460460
</>

0 commit comments

Comments
 (0)