-
Notifications
You must be signed in to change notification settings - Fork 7.8k
Closed
Labels
Description
Summary
In https://react.dev/learn/typescript#adding-typescript-to-an-existing-react-project :
As you can see, -- has been converted to — (a non-ASCII em-dash). This happens during the site build step, so when someone copies this and pastes it into a terminal, they get an error.
The root cause is this file:
It applies SmartyPants to all text AST nodes in Markdown. Since <TerminalBlock> is implemented using only simple <div>s and the plugin does not skip contents aside from <style> and <script>, the plugin converts --save-dev to —save-dev in <TerminalBlock>.
I think the fix would involve two steps:
- Use
<pre>or<code>appropriately to render the contents of<TerminalBlock> - In the plugin above, skip applying SmartyPants not only when the parent tag is
<script>/<styule>but also when it's<code>or<pre>