gatsbyjs / gatsby

The best React-based framework with performance, scalability and security built in.
https://www.gatsbyjs.com
MIT License
55.21k stars 10.33k forks source link

gatsby-plugin-mdx randomly inserts non breaking spaces #31559

Closed joeplaa closed 3 years ago

joeplaa commented 3 years ago

Description

Some lines (text) are not properly broken up on when using MDX. This is especially annoying on mobile, where the lines will run out of the screen. When looking into the generated html, these lines have   instead of regular spaces. I can't find anything odd or specific in our markdown that could trigger this.

Steps to reproduce

  1. Clone demo: https://github.com/joeplaa/gatsby-mdx-repro-31559
  2. Install and run develop
  3. Browse to article "Hoeveel btw zit er op iZettle diensten?" (top of page)
  4. Search for "Je zou misschien denken"
  5. Open devtools in Chrome (or equivalent in other browser) and view element with text from search above. It shows it is rendered as: Je zou misschien denken dat je deze uitgaven dan helemaal niet in 

image

Expected result

MDX/markdown/Gatsby should not insert non breaking spaces. Instead it should only insert normal spaces.

Actual result

Multiple lines contain non breaking spaces without explicitly having typed them.

Environment

  System:
    OS: Windows 10 10.0.19042
    CPU: (8) x64 Intel(R) Xeon(R) CPU E3-1245 v3 @ 3.40GHz
  Binaries:
    Node: 12.21.0 - C:\Program Files\nodejs\node.EXE
    Yarn: 1.22.5 - C:\Program Files (x86)\Yarn\bin\yarn.CMD
    npm: 6.14.11 - C:\Program Files\nodejs\npm.CMD
  Languages:
    Python: 2.7.15 - /c/Users/Joepje/.windows-build-tools/python27/python
  Browsers:
    Edge: Spartan (44.19041.964.0), Chromium (90.0.818.66)
  npmPackages:
    gatsby: ^3.4.1 => 3.4.1 
    gatsby-plugin-mdx: ^2.5.1 => 2.5.1 
    gatsby-source-filesystem: ^3.5.0 => 3.5.0 
LekoArts commented 3 years ago

Hi!

Sorry to hear you're running into an issue. To help us best begin debugging the underlying cause, it is incredibly helpful if you're able to create a minimal reproduction. This is a simplified example of the issue that makes it clear and obvious what the issue is and how we can begin to debug it. It must be on Gatsby v3 and the latest version of gatsby-plugin-mdx. Please also remove any other plugins until you see the issue.

If you're up for it, we'd very much appreciate if you could provide a minimal reproduction and we'll be able to take another look.

Thanks for using Gatsby! ๐Ÿ’œ

joeplaa commented 3 years ago

@LekoArts

Sure. I updated the link in original description (and environment info) to a minimal demo with gatsby v3 and gatsby-plugin-mdx v2.5.1. Let me know if that is indeed what you're looking for.

github-actions[bot] commented 3 years ago

Hiya!

This issue has gone quiet. Spooky quiet. ๐Ÿ‘ป

We get a lot of issues, so we currently close issues after 60 days of inactivity. Itโ€™s been at least 20 days since the last update here. If we missed this issue or if you want to keep it open, please reply here. As a friendly reminder: the best way to see this issue, or any other, fixed is to open a Pull Request. Check out gatsby.dev/contribute for more information about opening PRs, triaging issues, and contributing!

Thanks for being a part of the Gatsby community! ๐Ÿ’ช๐Ÿ’œ

joeplaa commented 3 years ago

This is still an issue. Don't close.

github-actions[bot] commented 3 years ago

Hiya!

This issue has gone quiet. Spooky quiet. ๐Ÿ‘ป

We get a lot of issues, so we currently close issues after 60 days of inactivity. Itโ€™s been at least 20 days since the last update here. If we missed this issue or if you want to keep it open, please reply here. As a friendly reminder: the best way to see this issue, or any other, fixed is to open a Pull Request. Check out gatsby.dev/contribute for more information about opening PRs, triaging issues, and contributing!

Thanks for being a part of the Gatsby community! ๐Ÿ’ช๐Ÿ’œ

joeplaa commented 3 years ago

Still waiting for a reply.

github-actions[bot] commented 3 years ago

Hiya!

This issue has gone quiet. Spooky quiet. ๐Ÿ‘ป

We get a lot of issues, so we currently close issues after 60 days of inactivity. Itโ€™s been at least 20 days since the last update here. If we missed this issue or if you want to keep it open, please reply here. As a friendly reminder: the best way to see this issue, or any other, fixed is to open a Pull Request. Check out gatsby.dev/contribute for more information about opening PRs, triaging issues, and contributing!

Thanks for being a part of the Gatsby community! ๐Ÿ’ช๐Ÿ’œ

joeplaa commented 3 years ago

Keep open please.

umortenb commented 3 years ago

I just had a similar problem, and noticed that content pasted to a CMS from Microsoft Word contained non breaking spaces, which look exactly the same as normal spaces, but get converted differently. They are visible through small dots when marking them in VSCode: image

joeplaa commented 3 years ago

Thanks @umbiermann, that solved my problem too!!! We initially copied all our existing posts from WordPress to Gatsby and some of those posts were indeed originally written in Microsoft Word, which explains where those non-breaking spaces come from. Apparently WordPress is less strict when it comes to displaying them.

@LekoArts, I'll close this issue as my problem is solved and this is not, strictly speaking, a Gatsby issue.