0

在所见即所得编辑器中输入的文本以以下格式保存

<p class="MsoListParagraph" style="text-indent: -18pt; margin-left: 18pt; mso-list: l0 level1 lfo1;"><!--[if !supportLists]--><span lang="EN-US" style="font-family: Symbol; font-size: 10pt; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol; mso-ansi-language: EN-US;">·<span style="line-height: normal; font-family:; font-size: 7pt; font-stretch: normal;" roman";"="" new="" times="">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span></span><!--[endif]-->
<span lang="EN-US" style="font-family:; font-size: 10pt;" tahoma",sans-serif;mso-ansi-language:en-us"="">Some<span lang="EN-US" style='color: rgb(31, 73, 125); font-family: "Arial",sans-serif; font-size: 10pt; mso-fareast-font-family: Gulim; mso-ansi-language: EN-US; mso-fareast-language: KO; mso-bidi-language: AR-SA;'>Text</span>
<span lang="EN-US" style='color: black; font-family: "Arial",sans-serif; font-size: 10pt; mso-fareast-font-family: Gulim; mso-ansi-language: EN-US; mso-fareast-language: KO; mso-bidi-language: AR-SA;'> to</span><span lang="EN-US" style='color: rgb(31, 73, 125); font-family: "Arial",sans-serif; font-size: 10pt; mso-fareast-font-family: Gulim; mso-ansi-language: EN-US; mso-fareast-language: KO; mso-bidi-language: AR-SA;'> be in </span>entered by user</span><span style="line-height: 1.4;">&nbsp;</span></p>
<p class="MsoListParagraph" style="margin-left: 18pt;"><span lang="EN-GB" style="font-family:; font-size: 10pt;" tahoma",sans-serif;mso-ansi-language:en-gb"="">Comments entered by user.</span><span lang="EN-US" style="font-family:; font-size: 10pt;" tahoma",sans-serif;mso-ansi-language:en-us"=""><o:p></o:p></span></p>

应该在编辑器的文本区域中显示的文本是“用户输入的一些文本”

但是文本区域显示为空白,并且没有按预期显示文本。

在“检查元素”上,没有附加整个 p 元素,而是存在 <br>。如果我在 html 文件中运行上述 HTML,它会按预期呈现和显示。

下面是视图中的代码片段

<div text-angular id="texteditor1" class="texteditorharmonize" ng-model="Comments"></div>

@Html.TextAreaFor(model => model.Comments, new { @id = "Comments1", @type = "hidden", @style = "display:none;", Value = "texted" })

app.js 文件中的代码如下

 $scope.Comments = $("#Comments1").val();

此外,在 DOM 中检查时,角度 js 似乎会自动生成以下代码。

 <div class="popover fade bottom" style="max-width: none; width: 305px;"><div class="arrow"></div><div class="popover-content"></div></div>
 <div class="ta-resizer-handle-overlay"><div class="ta-resizer-handle-background"></div><div class="ta-resizer-handle-corner ta-resizer-handle-corner-tl"></div><div class="ta-resizer-handle-corner ta-resizer-handle-corner-tr"></div><div class="ta-resizer-handle-corner ta-resizer-handle-corner-bl"></div><div class="ta-resizer-handle-corner ta-resizer-handle-corner-br"></div><div class="ta-resizer-handle-info"></div></div>
 <div id="taTextElement7118600111813864" contenteditable="true" ta-bind="ta-bind" ng-model="html" class="ng-pristine ng-untouched ng-valid ta-bind">
 <p><br></p></div> <!--the <p class="MsoListParagraph" etc...should be present in place of <br> in this line-->
4

1 回答 1

0

TextAngular 试图去除 MS Word HTML 类(即 MSNormal)。

相关代码位于textAngular taBind.js中,从第 535 行开始。

不过,我不知道有什么方法可以关闭此功能。

于 2017-01-04T16:34:21.083 回答