9

There are additional newlines that are added (on top of the existing ones) after pasting into the query bar. This will work on any text with newlines.
Simply copy some text (that contains a newline) and paste it in to the query bar to reproduce.
Do note that newline that appeared in the file was not repeated.

I expect the text to be pasted in exactly as it was formatted from the text editor window- I do not want additional newlines to be added (as they take up tokens and space on my screen).

    Able to reproduce on Orion and Firefox.

      I'm trying to paste code to ask for help, but it's behaving incredibly jank for me when it comes to new lines, doubling all newlines

      For example, when I paste the following code:

      import random
      import requests
      
      def example():
          print("Hello\nWorld")
      
      for i in range(32):
          example()

      ...it becomes this absolute mess. Somehow, the "\n" in the print statement also got replaced with an actual new line which is crazy

      I am on Firefox

        Merged 2 posts from Pasting text/code with new lines into new assistant is incredibly broken.

          It does look like something intentionally put in, based on a quick look at the webpage code. There is a regex replace function, whose sole purpose (as it appears) is to cause this effect.

          There is this snippet:

          n.addEventListener("paste", e => {
              e.preventDefault(),
              document.execCommand("insertText", !1, e.clipboardData.getData("text/plain").replace(/(?:\\[rn]|[\r\n]+)+/g, "\n\n"))
          }

          from: https://assets.kagi.com/v2/js/build/assistant/assistant.bundle.js?v=3b25032906c6a822a6ad6a75f76d0e3d89505312

          Which appears to cause this effect.

            7 days later

            When using the Kagi assistant for helping with coding, I often times want to paste in code snippets that contain \n or \r escape characters.

            However, the Kagi Assistant when these characters are pasted in actually interprets them as newlines or double newlines respectively. This can be kind of annoying as it messes up my input.

            Reproduce by putting the following in your clipboard, and paste into the Kagi Assistant: hello\nthis is a new line

            Thanks!

            I expected the text to be preserved as it appears in the clipboard, and paste literally as hello\nthis is a new line

              Merged 2 posts from Kagi Assistant escape characters.
                8 days later
                No one is typing