Skip to content

fix: escape markdown in users OG image#7474

Merged
zomars merged 4 commits intomainfrom
fix-markdown-in-og
Mar 2, 2023
Merged

fix: escape markdown in users OG image#7474
zomars merged 4 commits intomainfrom
fix-markdown-in-og

Conversation

@G3root
Copy link
Copy Markdown
Contributor

@G3root G3root commented Mar 2, 2023

What does this PR do?

Fixes #7281

Environment: Staging(main branch) / Production

Type of change

  • Bug fix (non-breaking change which fixes an issue)

@G3root G3root requested review from a team and CarinaWolli March 2, 2023 17:21
@vercel
Copy link
Copy Markdown

vercel bot commented Mar 2, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated
cal ✅ Ready (Inspect) Visit Preview 💬 Add your feedback Mar 2, 2023 at 6:41PM (UTC)
1 Ignored Deployment
Name Status Preview Comments Updated
ui ⬜️ Ignored (Inspect) Visit Preview Mar 2, 2023 at 6:41PM (UTC)

@CarinaWolli
Copy link
Copy Markdown
Member

@G3root how can I test that?

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Mar 2, 2023

📦 Next.js Bundle Analysis

This analysis was generated by the next.js bundle analysis action 🤖

🎉 Global Bundle Size Decreased

Page Size (compressed)
global 212.66 KB (🟢 -52 B)
Details

The global bundle is the javascript bundle that loads alongside every page. It is in its own category because its impact is much higher - an increase to its size means that every page on your website loads slower, and a decrease means every page loads faster.

Any third party scripts you have added directly to your app using the <script> tag are not accounted for in this analysis

If you want further insight into what is behind the changes, give @next/bundle-analyzer a try!

Sixty-three Pages Changed Size

The following pages changed size from the code in this PR compared to its base branch:

Page Size (compressed) First Load % of Budget (350 KB)
/[user] 109.45 KB 322.11 KB 92.03% (🟢 -0.34%)
/[user]/[type] 97.73 KB 310.39 KB 88.68% (🟢 -0.07%)
/[user]/[type]/embed 97.76 KB 310.42 KB 88.69% (🟢 -0.07%)
/[user]/book 156.99 KB 369.65 KB 105.62% (🟢 -8.15%)
/[user]/embed 109.51 KB 322.17 KB 92.05% (🟢 -0.34%)
/apps 166.7 KB 379.36 KB 108.39% (+/- <0.01%)
/apps/[slug] 190.29 KB 402.95 KB 115.13% (🟢 -0.01%)
/apps/[slug]/[...pages] 388.27 KB 600.93 KB 171.69% (🟢 -0.13%)
/apps/categories 152.22 KB 364.88 KB 104.25% (+/- <0.01%)
/apps/categories/[category] 155.5 KB 368.16 KB 105.19% (🟢 -0.01%)
/apps/installed/[category] 193.92 KB 406.58 KB 116.17% (🟡 +0.22%)
/auth/forgot-password 181.08 KB 393.74 KB 112.50% (🟢 -0.01%)
/auth/forgot-password/[id] 40.64 KB 253.3 KB 72.37% (+/- <0.01%)
/auth/login 195.06 KB 407.73 KB 116.49% (+/- <0.01%)
/auth/setup 241.03 KB 453.69 KB 129.63% (🟢 -0.03%)
/availability 155.32 KB 367.98 KB 105.14% (🟡 +0.01%)
/availability/[schedule] 265.87 KB 478.53 KB 136.72% (🟢 -0.07%)
/availability/troubleshoot 152.91 KB 365.57 KB 104.45% (+/- <0.01%)
/booking/[uid] 128.24 KB 340.9 KB 97.40% (🟢 -0.29%)
/bookings/[status] 261.95 KB 474.61 KB 135.60% (🟢 -0.08%)
/d/[link]/[slug] 97.38 KB 310.04 KB 88.58% (🟢 -0.07%)
/d/[link]/[slug]/embed 97.41 KB 310.07 KB 88.59% (🟢 -0.07%)
/d/[link]/book 156.65 KB 369.31 KB 105.52% (🟢 -8.15%)
/event-types 237.7 KB 450.36 KB 128.67% (🟢 -0.11%)
/event-types/[type] 265.79 KB 478.46 KB 136.70% (🟢 -1.47%)
/getting-started/[[...step]] 328.49 KB 541.15 KB 154.61% (🟢 -0.01%)
/more 151.85 KB 364.51 KB 104.15% (🟢 -0.01%)
/payment/[uid] 68.43 KB 281.09 KB 80.31% (🟡 +0.03%)
/settings/admin 156.7 KB 369.37 KB 105.53% (+/- <0.01%)
/settings/admin/apps 189.37 KB 402.03 KB 114.86% (🟢 -0.02%)
/settings/admin/apps/[category] 189.35 KB 402.01 KB 114.86% (🟢 -0.02%)
/settings/admin/impersonation 156.99 KB 369.65 KB 105.61% (+/- <0.01%)
/settings/billing 156.9 KB 369.56 KB 105.59% (+/- <0.01%)
/settings/developer/api-keys 185.94 KB 398.6 KB 113.89% (🟢 -0.02%)
/settings/developer/webhooks 159.23 KB 371.89 KB 106.26% (🟢 -0.02%)
/settings/developer/webhooks/[id] 188.16 KB 400.82 KB 114.52% (🟢 -0.03%)
/settings/developer/webhooks/new 188.01 KB 400.67 KB 114.48% (🟢 -0.03%)
/settings/my-account/appearance 170.6 KB 383.26 KB 109.50% (🟢 -0.02%)
/settings/my-account/calendars 189.65 KB 402.31 KB 114.95% (🟡 +0.16%)
/settings/my-account/conferencing 161.2 KB 373.86 KB 106.82% (🟡 +0.02%)
/settings/my-account/general 261.52 KB 474.18 KB 135.48% (+/- <0.01%)
/settings/my-account/profile 433.91 KB 646.57 KB 184.73% (+/- <0.01%)
/settings/security/impersonation 158.81 KB 371.47 KB 106.13% (🟢 -0.02%)
/settings/security/password 327.76 KB 540.43 KB 154.41% (🟢 -0.12%)
/settings/security/sso 166.69 KB 379.35 KB 108.38% (+/- <0.01%)
/settings/security/two-factor-auth 299.83 KB 512.49 KB 146.43% (🟢 -0.03%)
/settings/teams 156.45 KB 369.11 KB 105.46% (+/- <0.01%)
/settings/teams/[id]/appearance 170.61 KB 383.27 KB 109.51% (🟢 -0.03%)
/settings/teams/[id]/billing 156.68 KB 369.34 KB 105.53% (🟢 -0.01%)
/settings/teams/[id]/members 292.24 KB 504.9 KB 144.26% (🟢 -0.02%)
/settings/teams/[id]/onboard-members 73.23 KB 285.89 KB 81.68% (+/- <0.01%)
/settings/teams/[id]/profile 268.88 KB 481.54 KB 137.58% (+/- <0.01%)
/settings/teams/[id]/sso 166.78 KB 379.44 KB 108.41% (+/- <0.01%)
/settings/teams/new 112.05 KB 324.71 KB 92.77% (+/- <0.01%)
/signup 25.19 KB 237.85 KB 67.96% (+/- <0.01%)
/team/[slug] 112.65 KB 325.31 KB 92.95% (🟢 -0.10%)
/team/[slug]/[type] 97.38 KB 310.04 KB 88.58% (🟢 -0.07%)
/team/[slug]/[type]/embed 97.41 KB 310.07 KB 88.59% (🟢 -0.07%)
/team/[slug]/book 156.65 KB 369.31 KB 105.52% (🟢 -8.15%)
/team/[slug]/embed 112.72 KB 325.38 KB 92.97% (🟢 -0.10%)
/teams 151.92 KB 364.58 KB 104.17% (🟢 -0.01%)
/workflows 164.54 KB 377.2 KB 107.77% (+/- <0.01%)
/workflows/[workflow] 292.28 KB 504.95 KB 144.27% (🟢 -0.11%)
Details

Only the gzipped size is provided here based on an expert tip.

First Load is the size of the global bundle plus the bundle for the individual page. If a user were to show up to your website and land on a given page, the first load size represents the amount of javascript that user would need to download. If next/link is used, subsequent page loads would only need to download that page's bundle (the number in the "Size" column), since the global bundle has already been downloaded.

Any third party scripts you have added directly to your app using the <script> tag are not accounted for in this analysis

The "Budget %" column shows what percentage of your performance budget the First Load total takes up. For example, if your budget was 100kb, and a given page's first load size was 10kb, it would be 10% of your budget. You can also see how much this has increased or decreased compared to the base branch of your PR. If this percentage has increased by 20% or more, there will be a red status indicator applied, indicating that special attention should be given to this. If you see "+/- <0.01%" it means that there was a change in bundle size, but it is a trivial enough amount that it can be ignored.

@G3root
Copy link
Copy Markdown
Contributor Author

G3root commented Mar 2, 2023

@CarinaWolli try http://localhost:3000/api/social/og/image?type=generic&title=hello&description=**hello** locally . the markdown would be stripped

Copy link
Copy Markdown
Contributor

@zomars zomars left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@zomars zomars merged commit 5fe0ca7 into main Mar 2, 2023
@zomars zomars deleted the fix-markdown-in-og branch March 2, 2023 19:55
dmkav pushed a commit to join-com/cal-com that referenced this pull request Mar 6, 2023
* fix: escape markdown in bio

* chore: add remark and strip-markdown package

* feat: strip markdown

* fix: remove first commit
@G3root G3root mentioned this pull request Mar 13, 2023
1 task
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Markdown syntax in profile description not sanitised out in OG metadata

3 participants