Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update to Docusaurus 3.5.2 and render flowcharts #1601

Merged
merged 2 commits into from
Oct 4, 2024
Merged

Conversation

alexandratran
Copy link
Contributor

@alexandratran alexandratran commented Oct 3, 2024

Description

This PR:

  • Updates Docusaurus and all @docusaurus/-namespaced packages to the latest version 3.5.2.
  • Fixes an issue with the text not rendering properly in Mermaid flowchart diagrams by setting securityLevel to loose in the Mermaid config.

Context

I noticed that in the production deployment, Mermaid flowchart diagrams don't render any of the text labels (see here and here).

Going back into the commit history, it looks like something in PR #1563 broke the text rendering of Mermaid flowcharts. The text displays properly in the first preview deployment of the PR, and doesn't display at all in the last preview deployment of the PR.

I first tried updating all Docusaurus packages to the latest version (which should be done anyway). When this didn't solve it, I inspected the DOM, and it looks like the text might be rendering as a foreignObject HTML element:
Screenshot 2024-10-03 at 3 22 48 PM

Setting the securityLevel on Mermaid diagrams to loose enables script elements and fixes the text rendering issue.

Preview

https://metamask-docs-git-fix-diagrams-metamask-web.vercel.app/wallet/concepts/sdk/connections/#initial-connection-flow

Checklist

Complete this checklist before merging your PR:

  • If this PR contains a major change to the documentation content, I have added an entry to the top of the "What's new?" page.
  • The proposed changes have been reviewed and approved by a member of the documentation team.

@alexandratran alexandratran requested review from a team as code owners October 3, 2024 22:29
Copy link

vercel bot commented Oct 3, 2024

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

Name Status Preview Comments Updated (UTC)
metamask-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Oct 4, 2024 4:32pm

Copy link

socket-security bot commented Oct 3, 2024

Removed dependencies detected. Learn more about Socket for GitHub ↗︎

🚮 Removed packages: npm/[email protected]

View full report↗︎

@alexandratran alexandratran self-assigned this Oct 4, 2024
@alexandratran alexandratran merged commit d6d5b12 into main Oct 4, 2024
17 checks passed
@alexandratran alexandratran deleted the fix-diagrams branch October 4, 2024 16:41
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.

3 participants