Skip to content

fix(code block): use <div> for Firefox code block line breaks#1885

Merged
farnabaz merged 1 commit into
nuxt:mainfrom
nobkd:fix-highlight/firefox-line-breaks
Feb 7, 2023
Merged

fix(code block): use <div> for Firefox code block line breaks#1885
farnabaz merged 1 commit into
nuxt:mainfrom
nobkd:fix-highlight/firefox-line-breaks

Conversation

@nobkd

@nobkd nobkd commented Feb 4, 2023

Copy link
Copy Markdown
Contributor

🔗 Linked issue

#1883

❓ Type of change

  • 📖 Documentation (updates to the documentation or readme)
  • 🐞 Bug fix (a non-breaking change that fixes an issue)
  • 👌 Enhancement (improving an existing functionality like performance)
  • ✨ New feature (a non-breaking change that adds functionality)
  • ⚠️ Breaking change (fix or feature that would cause existing functionality to change)

📚 Description

Using divs for highlighted code blocks (instead of spans) to preserve line breaks when copying selection in Firefox.
Inline codes aren't affected, because those only use the children of the first "line" as content.

📝 Checklist

  • I have linked an issue or discussion.
  • I have updated the documentation accordingly.

@codesandbox

codesandbox Bot commented Feb 4, 2023

Copy link
Copy Markdown

CodeSandbox logoCodeSandbox logo  Open in CodeSandbox Web Editor | VS Code | VS Code Insiders

@netlify

netlify Bot commented Feb 4, 2023

Copy link
Copy Markdown

Deploy Preview for nuxt-content ready!

Name Link
🔨 Latest commit
🔍 Latest deploy log https://app.netlify.com/sites/nuxt-content/deploys/63e27828c27ee70687636114
😎 Deploy Preview https://deploy-preview-1885--nuxt-content.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.

@nobkd nobkd marked this pull request as ready for review February 5, 2023 00:06
@nobkd nobkd changed the title fix(highlight): use <br> for code block line breaks fix(code block): use <div> for code block line breaks Feb 5, 2023
@nobkd nobkd changed the title fix(code block): use <div> for code block line breaks fix(code block): use <div> for Firefox code block line breaks Feb 5, 2023

@farnabaz farnabaz left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks

@farnabaz farnabaz merged commit 246bad9 into nuxt:main Feb 7, 2023
@nobkd nobkd deleted the fix-highlight/firefox-line-breaks branch February 7, 2023 16:22
@farnabaz farnabaz mentioned this pull request Mar 8, 2023
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.

2 participants