gatsby-plugin-mdx randomly inserts non breaking spaces
See original GitHub issueDescription
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
- Clone demo: https://github.com/joeplaa/gatsby-mdx-repro-31559
- Install and run develop
- Browse to article “Hoeveel btw zit er op iZettle diensten?” (top of page)
- Search for “Je zou misschien denken”
- 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
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
Issue Analytics
- State:
- Created 2 years ago
- Comments:10 (1 by maintainers)
Top Results From Across the Web
gatsby-plugin-mdx
gatsby -plugin-mdx is the official integration for using MDX with Gatsby. MDX is markdown for the component era. It lets you write JSX...
Read more >Non-Breaking Space Randomly Inserting Upon Saving ...
Every time I save my document, a non-breaking space is inserting before a specific word. Maybe someone using the system created a shortcut....
Read more >Creating New Gatsby Theme with Typescript, MDX, and ...
Gatsby Themes provide a powerful way to share an opinionated set of configurations across multiple Gatsby sites.
Read more >Tags | Katie Kodes
Jitterbit: replace a non-breaking space (07 Oct 2022); Jitterbit: backfill Salesforce ID into a database (13 Sep 2022); Can eProcurement reach Banner?
Read more >100DaysOfGatsby - Paul Scanlon
Once the UI part is done i hope to be investigating a source plugin which will be great as it's not something i've...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
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:
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.