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

fix(theme): add more tag names to inline code element set #8190

Merged
merged 1 commit into from Oct 12, 2022

Conversation

Josh-Cena
Copy link
Collaborator

Pre-flight checklist

Motivation

I should have done this initially but was too lazy to. This list is adapted from https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/Content_categories#phrasing_content

Test Plan

Test links

Deploy preview: https://deploy-preview-_____--docusaurus-2.netlify.app/

Related issues/PRs

@Josh-Cena Josh-Cena added pr: bug fix This PR fixes a bug in a past release. to backport This PR is planned to be backported to a stable version of Docusaurus labels Oct 8, 2022
@facebook-github-bot facebook-github-bot added the CLA Signed Signed Facebook CLA label Oct 8, 2022
@netlify
Copy link

netlify bot commented Oct 8, 2022

[V2]

Name Link
🔨 Latest commit 8b97b3a
🔍 Latest deploy log https://app.netlify.com/sites/docusaurus-2/deploys/6340d55d186e0800092833a0
😎 Deploy Preview https://deploy-preview-8190--docusaurus-2.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@github-actions
Copy link

github-actions bot commented Oct 8, 2022

⚡️ Lighthouse report for the deploy preview of this PR

URL Performance Accessibility Best Practices SEO PWA Report
/ 🟠 84 🟢 98 🟢 100 🟢 100 🟠 80 Report
/docs/installation 🟠 86 🟢 100 🟢 100 🟢 100 🟢 90 Report

@github-actions
Copy link

github-actions bot commented Oct 8, 2022

Size Change: 0 B

Total Size: 816 kB

ℹ️ View Unchanged
Filename Size
website/.docusaurus/globalData.json 52.4 kB
website/build/assets/css/styles.********.css 112 kB
website/build/assets/js/main.********.js 611 kB
website/build/index.html 40.9 kB

compressed-size-action

@slorber
Copy link
Collaborator

slorber commented Oct 12, 2022

LGTM 👍 thanks

Just to remember the context, is this only useful when using <code> tags in mdx?

like heyheyhey ? 🤪

@slorber slorber merged commit aa7d81d into main Oct 12, 2022
@slorber slorber deleted the fix-inline-tag branch October 12, 2022 16:03
@slorber slorber changed the title fix(theme): add more tag names to inline element set fix(theme): add more tag names to inline code element set Oct 12, 2022
@Josh-Cena
Copy link
Collaborator Author

Just to remember the context, is this only useful when using <code> tags in mdx?

Yep, which is why I still excluded some non-typographic tags. Bundle size phobia. Let's hope no one complains.

@slorber slorber added backported This PR has been backported to a stable version of Docusaurus and removed to backport This PR is planned to be backported to a stable version of Docusaurus labels Nov 2, 2022
@slorber
Copy link
Collaborator

slorber commented Jan 6, 2023

For reference, with MDX 2.0 (PR: #8288) all the lower-case JSX elements (like <code> will not be swaped by our own <Code> theme component

This is now your responsibility to create/import your own Code component in case the default behavior of MDX 2.0 is not good for your use case. I think it should be good in most cases as it's just rendering the dom nodes as is, like the web behaves.

The theme MDXComponents/Code component will only be used when using fenced code blocks (that's a design decision of MDX 2).

I'm removing the code to render elements inline anyway because fanced code blocks are never rendered inline.

This if/else logic was added only to mitigate the fact it was not easy to distinguish between fenced code blocks and usage of <code> through JSX, so that seems safe to remove

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backported This PR has been backported to a stable version of Docusaurus CLA Signed Signed Facebook CLA pr: bug fix This PR fixes a bug in a past release.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Inconsistent display when b, i, s, or u tags are used within code tags
3 participants