In addition to not being able to paste text with angle brackets anywhere in any line, other characters are interpreted as Legend code or commands when pasted, but not when typed in manually. There should be no difference between pasting and typing text.
In particular, pasting text with a forward slash as the first character seems to create links, tasks, etc. This causes problems in regular items, and especially in code blocks, where a code snippet starting with a comment line causes the code to be completely re-written.
For example, pasting this text with a slash at the beginning:
/ That was a slash.
and
/* That was a slash and an asterisk.
Produce the following:
Pasted as a regular item, the first creates a task, that displays parts of the markup for a link, plus an actual “file” link inside the brackets. With the second, the text becomes the link text for a “file” link. The second line is selected, showing the markdown. In the third line, I typed a backtick, then pasted it, then another backtick, but they don’t create an inline code block. I did the same with the second example, and it did.
Typing three backticks to create a fenced code block, then pasting, is also shown.
A real-world example with code blocks:
Note also the left alignment is different.
Also, within code blocks, if the pasted text starts with other characters that Legend uses as prefixes ( # - 1. [[
etc.) they will be removed from the code. For example, the standard opening line of a shell script, #!/bin/bash
will be re-written as !/bin/bash
, causing the script to fail. Or these comments if placed at the beginning of a shell script snippet:
# sudo rm -rf *
# is a very dangerous command, don't do it!
would become executable code: