Copying and Pasting Text

When copying and pasting goes wrong

Special care should be taken when copying and pasting text into T4. The text you copy carries more with it than just the text data. It also carries the text styling, like the size and color, and sometimes even the container around it. When text gets pasted into T4, it brings with it all of this extra formatting that gets converted into code in the T4 text editor. Fortunately, there are a few ways to avoid this.

Avoiding pasting issues

When copying text, not much can be done about picking up the extra styling applied to the text. But you can avoid it when pasting the text.

Pasting text by using ctrl+shift+v will allow you to paste “plain text”, meaning just the text with no additional colors, sizes, links, or other fluff.

You can also paste text into a “plain text editor” like Notepad on Windows or Textedit on Mac. These plain text editors do not support text formatting, so when you paste the text in, all of the styling gets removed. You simply paste the text in, copy it from the text editor, and paste it into T4, where you can then apply the formatting options that you want - and not the ones you don’t.