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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multi-line code blocks copied from browser have ^J (control J) instead of newlines #2506

Open
simonmichael opened this issue Dec 12, 2024 · 0 comments
Labels
C-bug Category: A bug, incorrect or unintended behavior

Comments

@simonmichael
Copy link

simonmichael commented Dec 12, 2024

Problem

Multi-line code blocks copied from browser have ^J (control J) instead of newlines. This breaks the copy-pasting of multiple shell commands from docs into a terminal.

Steps

  1. Create a code block like

    echo a
    echo b
    
  2. Generate and view the site in a web browser (tested with safari and brave on mac)

  3. Copy the two lines above

  4. Paste into a terminal

Expected: two echo commands, that both run, printing a and b.

Actual: echo a^Jecho b is pasted, only the first echo command runs, only a is printed.

At the time of writing this can also be seen at this code block:
https://hledger.org/install.html#build-in-a-source-checkout

Possible Solution(s)

No response

Notes

No response

Version

mdbook v0.4.21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: A bug, incorrect or unintended behavior
Projects
None yet
Development

No branches or pull requests

1 participant