script-lab icon indicating copy to clipboard operation
script-lab copied to clipboard

Copy to clipboard outputing escape characters in template content

Open AlexJerabek opened this issue 7 years ago • 6 comments

Bug Report

  • Host: All
  • OS: Windows 10
  • Browser: N/A
  • Environment: Beta

Expected behavior:

Share | Copy to clipboard should give me output able to be pasted into Notepad++ (or whatever editor). New lines in Script Lab should be new lines in the text.

Actual behavior:

The template section (and only the template section) is full of \s. Tabs and newlines are represented by \t and \n and quotes are also escaped.

Steps to Reproduce:

1.Share | Copy to clipboard 2. Copy into Notepad++

Screenshot:

escapecharacters

AlexJerabek avatar Oct 25 '18 22:10 AlexJerabek

This should be fixed in Beta now, please reopen if the issue persists.

nico-bellante avatar Nov 28 '18 23:11 nico-bellante

@nico-bellante I'm still having this happen for the HTML section. I can't reopen the issue since I'm not an admin on this repo.

AlexJerabek avatar Dec 28 '18 01:12 AlexJerabek

@AlexJerabek, reopened it for you

Zlatkovsky avatar Dec 28 '18 03:12 Zlatkovsky

@AlexJerabek , I also added you to give to the repo, so you should be able to re-open issues in the future.

Zlatkovsky avatar Dec 31 '18 21:12 Zlatkovsky

@AlexJerabek , just tried it with the same "Basic conditional formatting" snippet that you have in your repro -- and I am not able to repro. I am getting a beautifully multi-line template:

image

Is this happening to you with any snippet or with particular snippets?

FWIW, I still think there is some weird semi-nondeterministic behavior with the YAML parser, we had issues like that perennially in the older Script Lab (https://github.com/OfficeDev/script-lab-2017/issues/268). But if we can figure out the pattern -- and esp. if this is something that can be done deterministically just using the YAML parser library, outside of Script Lab --, perhaps we can find a cure.

Zlatkovsky avatar Dec 31 '18 21:12 Zlatkovsky

Here's a test snippet I just repoed this with: https://gist.github.com/AlexJerabek/372f1dd5f065d89217415f9fb3c348d1

I imported the snippet using the gist URL, copied to the clipboard, then pasted into a .yaml file opened in VS Code. Here's the screenshot: newlinechars

AlexJerabek avatar Dec 31 '18 22:12 AlexJerabek