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-classic): allow code tags containing inline elements to stay inline #6767

Merged
merged 1 commit into from
Mar 2, 2022

Conversation

Josh-Cena
Copy link
Collaborator

Motivation

Noticed this problem on our website:

image

The <a> tag inside <code> makes the latter be translated to CodeBlock. However, it's possible to make it stay as <code> since <a> is inline.

Have you read the Contributing Guidelines on pull requests?

Yes

Test Plan

The <code> works well on https://docusaurus.io/docs/api/themes/configuration#navbar-dropdown. http://localhost:3000/tests/pages/code-block-tests#code doesn't regress either.

@Josh-Cena Josh-Cena added the pr: bug fix This PR fixes a bug in a past release. label Feb 26, 2022
@facebook-github-bot facebook-github-bot added the CLA Signed Signed Facebook CLA label Feb 26, 2022
Comment on lines +40 to +51
const inlineElements = [
'a',
'b',
'big',
'i',
'span',
'em',
'strong',
'sup',
'sub',
'small',
];
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Maintaining this list is not ideal, but I doubt if it happens a lot anyways. We haven't heard anyone complaining so far

@netlify
Copy link

netlify bot commented Feb 26, 2022

✔️ [V2]

🔨 Explore the source changes: 02f7d1f

🔍 Inspect the deploy log: https://app.netlify.com/sites/docusaurus-2/deploys/6219b767c914b70007cf3043

😎 Browse the preview: https://deploy-preview-6767--docusaurus-2.netlify.app

@github-actions
Copy link

⚡️ Lighthouse report for the changes in this PR:

Category Score
🔴 Performance 42
🟢 Accessibility 100
🟢 Best practices 92
🟢 SEO 100
🟢 PWA 90

Lighthouse ran on https://deploy-preview-6767--docusaurus-2.netlify.app/

@github-actions
Copy link

Size Change: 0 B

Total Size: 789 kB

ℹ️ View Unchanged
Filename Size
website/.docusaurus/globalData.json 49.7 kB
website/build/assets/css/styles.********.css 106 kB
website/build/assets/js/main.********.js 596 kB
website/build/index.html 37.6 kB

compressed-size-action

@slorber
Copy link
Collaborator

slorber commented Mar 2, 2022

hmmm, we can give this a try 👍

@slorber slorber merged commit c1fb3de into main Mar 2, 2022
@slorber slorber deleted the jc/fix-inline-code branch March 2, 2022 12:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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.

3 participants