Open ycyaoxdu opened 2 years ago
/assign @morvencao
@ycyaoxdu It's not hard to trim the prompt character $
, but what about the command output?
A better solution IMO would be putting the command itself and command output in different html element.
/enhance
And also what if we have multiple commands in a code block, for example:
$ echo "Hello" >file.txt
$ cat file.txt
Hello
While using the
copy
function for coping the code snippet, I found it doesn't works properly:When i clicked the
copy
of step 2 code snippet 1 here, what i get in my clipboard is :the non-command lines which don't start with a
$
is also been copied.I'm wondering that if it is ok for just add a judgment rule to the copy function to determine whether the line is stared with
$
which means that it is a command should be copied.