Browse Source

📝 Fix copy button copying HTML markup on Termynal command lines

Several docs have terminal input lines written with HTML coloring, like
`$ <font color="#4E9A06">fastapi</font> dev`. Termynal animates the input
using textContent, so the <font> tags never render on screen, but the
Material copy button reads the underlying code and copies the literal
markup. Users end up pasting `<font color="#4E9A06">fastapi</font> dev`
instead of the command.

Strip the HTML wrappers from only the `$` input command lines so the
copy button yields the plain command, matching the homepage block which
already uses the plain form. The colored output lines below each command
are left unchanged.

See discussion #15700.
pull/15812/head
Patrick Wehbe 2 months ago
parent
commit
b419788430
  1. 2
      docs/en/docs/deployment/manually.md
  2. 2
      docs/en/docs/deployment/server-workers.md
  3. 2
      docs/en/docs/fastapi-cli.md
  4. 2
      docs/en/docs/tutorial/first-steps.md
  5. 2
      docs/en/docs/tutorial/index.md

2
docs/en/docs/deployment/manually.md

@ -7,7 +7,7 @@ In short, use `fastapi run` to serve your FastAPI application:
<div class="termy">
```console
$ <font color="#4E9A06">fastapi</font> run <u style="text-decoration-style:solid">main.py</u>
$ fastapi run main.py
<span style="background-color:#009485"><font color="#D3D7CF"> FastAPI </font></span> Starting production server 🚀

2
docs/en/docs/deployment/server-workers.md

@ -36,7 +36,7 @@ If you use the `fastapi` command:
<div class="termy">
```console
$ <font color="#4E9A06">fastapi</font> run --workers 4 <u style="text-decoration-style:solid">main.py</u>
$ fastapi run --workers 4 main.py
<span style="background-color:#009485"><font color="#D3D7CF"> FastAPI </font></span> Starting production server 🚀

2
docs/en/docs/fastapi-cli.md

@ -9,7 +9,7 @@ To run your FastAPI app for development, you can use the `fastapi dev` command:
<div class="termy">
```console
$ <font color="#4E9A06">fastapi</font> dev
$ fastapi dev
<span style="background-color:#009485"><font color="#D3D7CF"> FastAPI </font></span> Starting development server 🚀

2
docs/en/docs/tutorial/first-steps.md

@ -11,7 +11,7 @@ Run the live server:
<div class="termy">
```console
$ <font color="#4E9A06">fastapi</font> dev
$ fastapi dev
<span style="background-color:#009485"><font color="#D3D7CF"> FastAPI </font></span> Starting development server 🚀

2
docs/en/docs/tutorial/index.md

@ -15,7 +15,7 @@ To run any of the examples, copy the code to a file `main.py`, and start `fastap
<div class="termy">
```console
$ <font color="#4E9A06">fastapi</font> dev
$ fastapi dev
<span style="background-color:#009485"><font color="#D3D7CF"> FastAPI </font></span> Starting development server 🚀

Loading…
Cancel
Save