Skip to content

fix(theme-classic): allow code tags containing inline elements to stay inline - #6767

Merged
slorber merged 1 commit into
mainfrom
jc/fix-inline-code
Mar 2, 2022
Merged

slorber merged 1 commit into
mainfrom
jc/fix-inline-code

Conversation

@Josh-Cena

Copy link
Copy Markdown
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
Copy Markdown
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

netlify Bot commented Feb 26, 2022

Copy link
Copy Markdown

✔️ [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
Copy Markdown

⚡️ 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
Copy Markdown

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

slorber commented Mar 2, 2022

Copy link
Copy Markdown
Collaborator

hmmm, we can give this a try 👍

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