使用 TinyMCE 4,我已经按照此处的说明配置了插件的paste_as_text
选项。paste
它按预期工作,例如:
<p> </p>
<h1 dir="ltr" style="line-height: 1.38; margin-top: 20pt; margin-bottom: 6pt;"><span style="font-size: 20pt; font-family: Arial; color: #000000; font-variant-numeric: normal; font-variant-east-asian: normal; vertical-align: baseline; white-space: pre-wrap;">Requirements</span></h1>
<h3 dir="ltr" style="line-height: 1.38; margin-top: 16pt; margin-bottom: 4pt;"><span style="font-size: 14pt; font-family: Arial; color: #434343; font-variant-numeric: normal; font-variant-east-asian: normal; vertical-align: baseline; white-space: pre-wrap;">Nav Bar/Header</span></h3>
<ul style="margin-top: 0pt; margin-bottom: 0pt;">
<li dir="ltr" style="list-style-type: disc; font-size: 11pt; font-family: Arial; color: #000000; font-variant-numeric: normal; font-variant-east-asian: normal; vertical-align: baseline; white-space: pre;">
<p dir="ltr" style="line-height: 1.38; margin-top: 0pt; margin-bottom: 0pt;"><span style="font-size: 11pt; color: #000000; font-variant-numeric: normal; font-variant-east-asian: normal; vertical-align: baseline; white-space: pre-wrap;">Change EAT | DRINK to DISCOVER but keep this as the existing dropdown everywhere</span></p>
</li>
<li dir="ltr" style="list-style-type: disc; font-size: 11pt; font-family: Arial; color: #000000; font-variant-numeric: normal; font-variant-east-asian: normal; vertical-align: baseline; white-space: pre;">
<p dir="ltr" style="line-height: 1.38; margin-top: 0pt; margin-bottom: 0pt;"><span style="font-size: 11pt; color: #000000; font-variant-numeric: normal; font-variant-east-asian: normal; vertical-align: baseline; white-space: pre-wrap;">Change WATCH | READ to WATCH but keep this as the existing dropdown everywhere</span></p>
</li>
<li dir="ltr" style="list-style-type: disc; font-size: 11pt; font-family: Arial; color: #000000; font-variant-numeric: normal; font-variant-east-asian: normal; vertical-align: baseline; white-space: pre;">
<p dir="ltr" style="line-height: 1.38; margin-top: 0pt; margin-bottom: 0pt;"><span style="font-size: 11pt; color: #000000; font-variant-numeric: normal; font-variant-east-asian: normal; vertical-align: baseline; white-space: pre-wrap;">Keep EXPERIENCE as the existing dropdown everywhere</span></p>
</li>
</ul>
变成:
<p>Requirements<br />Nav Bar/Header<br />Change EAT | DRINK to DISCOVER but keep this as the existing dropdown everywhere<br />Change WATCH | READ to WATCH but keep this as the existing dropdown everywhere<br />Keep EXPERIENCE as the existing dropdown everywhere</p>
但是由于当我尝试设置第一行的样式时,所有的行都在一个单一<p>
的行中,例如将其更改为Heading 1
,因此所有文本都被格式化为那个。
我怎样才能避免这种情况?