Как произвести над текстом JSON Escape в рамках ZENNO?

udder

Client
Регистрация
28.03.2017
Сообщения
595
Благодарностей
118
Баллы
43
Необходимо подготовить текст для отправки по REST API Wordpress

ИСХОДНЫЙ ТЕКСТ
It's hard to believe, but I've never tested what actually happens if you do an rm -rf on the entire root partition. Once, early in my career, I made a mistake with a delete and ran a root delete. But it wasn't the rm command, it was something else. I don't remember the details anymore. Back then the servers were still ironclad and it really became a problem. The server had not been put into production yet, but I had already configured something on it. I immediately noticed the error and canceled the command. At first I thought it was nothing, but then I noticed that all symbolic links were missing, although the system was working in general and rebooted normally. I had to redo everything anyway.

And now I decided to see what would really happen after rm -rf / on a test virtualization. The command did not work in this form and asked me to add the --no-preserve-root key. I did so:
# rm -rf / --no-preserve-root

And everything was really deleted except the /dev partition and the loaded system modules in /sys/module/. And it was so mundane, without any special messages, fatal errors or anything else. You are sitting in a system where there is nothing but what was loaded into memory. The bash shell works, you can do something, but not much. There's no binary.

Only those utilities built into the shell work. For example, echo, pwd, type, cd, etc..:
# type cd
cd is a shell builtin
That is, you can move to /sys/module/. But you can't do anything there. You cannot connect to a new session or log in through the terminal. You cannot even do the reboot command. It's a binary, and it doesn't exist. Nevertheless
Преобразуем данный текст https://www.freeformatter.com/json-escape.html#before-output

На выходе:

It's hard to believe, but I've never tested what actually happens if you do an rm -rf on the entire root partition. Once, early in my career, I made a mistake with a delete and ran a root delete. But it wasn't the rm command, it was something else. I don't remember the details anymore. Back then the servers were still ironclad and it really became a problem. The server had not been put into production yet, but I had already configured something on it. I immediately noticed the error and canceled the command. At first I thought it was nothing, but then I noticed that all symbolic links were missing, although the system was working in general and rebooted normally. I had to redo everything anyway. \r\n\r\nAnd now I decided to see what would really happen after rm -rf \/ on a test virtualization. The command did not work in this form and asked me to add the --no-preserve-root key. I did so:\r\n# rm -rf \/ --no-preserve-root\r\n\r\nAnd everything was really deleted except the \/dev partition and the loaded system modules in \/sys\/module\/. And it was so mundane, without any special messages, fatal errors or anything else. You are sitting in a system where there is nothing but what was loaded into memory. The bash shell works, you can do something, but not much. There's no binary. \r\n\r\nOnly those utilities built into the shell work. For example, echo, pwd, type, cd, etc..:\r\n# type cd\r\ncd is a shell builtin\r\nThat is, you can move to \/sys\/module\/. But you can't do anything there. You cannot connect to a new session or log in through the terminal. You cannot even do the reboot command. It's a binary, and it doesn't exist. Nevertheless
Собственно здесь все было отформатировано по правилам:

  • Backspace заменяется на \b
  • Передача формы заменяется на \f
  • Новая строка заменяется на \n
  • Возврат каретки заменяется на \r
  • Табуляция заменяется на \t
  • Двойная кавычка заменяется на \"
  • Обратная косая черта заменяется на \\\
Как это реализовать внутри Zenno Через C# или JS? Слышал про либу Newtonsoft.Json но не понял как применить. Выручите плиз
@djaga @Ilshakin
 

bizzon

Client
Регистрация
08.09.2015
Сообщения
1 089
Благодарностей
126
Баллы
63
Необходимо подготовить текст для отправки по REST API Wordpress

ИСХОДНЫЙ ТЕКСТ


Преобразуем данный текст https://www.freeformatter.com/json-escape.html#before-output

На выходе:



Собственно здесь все было отформатировано по правилам:

  • Backspace заменяется на \b
  • Передача формы заменяется на \f
  • Новая строка заменяется на \n
  • Возврат каретки заменяется на \r
  • Табуляция заменяется на \t
  • Двойная кавычка заменяется на \"
  • Обратная косая черта заменяется на \\\
Как это реализовать внутри Zenno Через C# или JS? Слышал про либу Newtonsoft.Json но не понял как применить. Выручите плиз
@djaga @Ilshakin
 
  • Спасибо
Реакции: udder

Кто просматривает тему: (Всего: 1, Пользователи: 0, Гости: 1)