0
我在由KendoEditor小部件呈現的textarea中插入特殊字符時遇到問題。我已經通過以下方式配置了我的小部件:解析KendoEditor中的特殊字符TextArea
function configureRequestNotesEditor() {
$("#notes").kendoEditor({
resizable: {
content: true
},
pasteCleanup: {
all: true,
css: true,
keepNewLines: true,
msAllFormatting: true,
msConvertLists: true,
msTags: true,
none: false,
span: false
},
tools: [
"bold", "underline", "insertUnorderedList", "insertOrderedList", "indent", "outdent"
]
});
};
當我將數據發送到我的api時,我使用javascript函數escape()
,當我從api調用javascript函數返回時調用javascript函數unescape()
。 ,我輸入到textarea的字段中的文本如下:
Send to James in UW ASAP. See attached files. How long is this field?
300
The amount should be <any amount you can think of.
當數據保存,然後呈現回UI被打印到屏幕
<p>Send to James in UW ASAP. See attached files. How long is t his field?</p><p>300</p><p>The amount should be <any amount you can think of.</p>
的問題如下,如何以保存的相同方式獲取轉換的數據?我不正確地做什麼來防止這種情況?另外,我忘記提到在C#的後端,在將文本存儲到數據庫之前,我正在使用HttpUtility.HtmlDecode(randomText)
。