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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: do not need <wbr> anymore #12234

Merged
merged 2 commits into from
Mar 1, 2023
Merged

docs: do not need <wbr> anymore #12234

merged 2 commits into from
Mar 1, 2023

Conversation

fi3ework
Copy link
Member

@fi3ework fi3ework commented Feb 28, 2023

Description

Currently, such as process.env.NODE_ENV = 'development' in markdown is splitted into two parts which has redundant padding and border-radius, making the docs look weird. 馃槵

image

before:

before.mp4

after:

after.mp4

Additional context


What is the purpose of this pull request?

  • Bug fix
  • New Feature
  • Documentation update
  • Other

Before submitting the PR, please make sure you do the following

  • Read the Contributing Guidelines.
  • Read the Pull Request Guidelines and follow the PR Title Convention.
  • Check that there isn't already a PR that solves the problem the same way to avoid creating a duplicate.
  • Provide a description in this PR that addresses what the PR is solving, or reference the issue that it solves (e.g. fixes #123).
  • Ideally, include relevant tests that fail without this PR but pass with it.

@stackblitz
Copy link

stackblitz bot commented Feb 28, 2023

Review PR in StackBlitz Codeflow Run & review this pull request in StackBlitz Codeflow.

patak-dev
patak-dev previously approved these changes Feb 28, 2023
Copy link
Member

@patak-dev patak-dev left a comment

Choose a reason for hiding this comment

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

I wonder if this is something that VitePress would want to have upstream, cc @kiaking

@kiaking
Copy link
Contributor

kiaking commented Feb 28, 2023

Nice idea! However, looks like VitePress did fix this issue and maybe you can simple remove <wbr>...? VitePress Issue -> vuejs/vitepress#419

We're handling this in our markdown parser and it should be working.

FYI, Vite issue for this is currently open -> #5577

If it does not work, and if we need this css hack, not sure if we should add this to VitePress core to avoid adding unnecessary hacks as much as possible 馃

@fi3ework
Copy link
Member Author

fi3ework commented Mar 1, 2023

@kiaking I tested removing <wbr> in dev and it works fine. I used to think this <wbr> was some fine-tuning to make the line break better 馃槀. I'll make an update.

@fi3ework fi3ework requested a review from patak-dev March 1, 2023 04:06
@fi3ework fi3ework changed the title docs: avoid <code> being split by <wbr> docs: do not need <wbr> anymore Mar 1, 2023
Copy link
Member

@bluwy bluwy left a comment

Choose a reason for hiding this comment

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

Neat! I didn't know VitePress had fixed this natively. Looks like it's working: https://deploy-preview-12234--vite-docs-main.netlify.app/guide/api-javascript.html

@patak-dev
Copy link
Member

A lot better like this! Thanks Kia for the tip

@patak-dev patak-dev merged commit 48cd43b into vitejs:main Mar 1, 2023
@fi3ework fi3ework deleted the doc-wbr branch March 1, 2023 07:06
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.

None yet

4 participants