mdBook
mdBook copied to clipboard
Provide a mechanism for ignoring leading characters in a code block
This is coming from https://github.com/rust-lang/book/issues/1756
It'd be great for mdbook to provide some kind of mechanism to declare leading characters that should be ignored by the "copy to clipboard" button. Specifically in the Rust Book's case: to omit the leading $
characters from being copied to the clipboard. That will allow readers to paste commands into their terminal without having to manually edit the command.
Nodebook interactive tutorial book has done in with CSS and a simple regex https://github.com/oncletom/nodebook/blob/master/src/asciidoctor-extension-bash-dollar.js
Do you think it's a suitable way to achieve the same in mbBook?
Hi @ehuss , I am happy to take this on and send a PR. Would you be open to reviewing it?