gpt4 book ai didi

javascript - 从 word 粘贴到 extjs 编辑器

转载 作者:数据小太阳 更新时间:2023-10-29 05:37:51 25 4
gpt4 key购买 nike

我发现了 extjs 编辑器的另一个问题。

当我复制

<ol type="A" style="margin-top: 0pt; margin-bottom: 0pt;">
<li style="line-height: 115%; font-size: 11pt; margin-top: 0pt; margin-bottom: 10pt;"><span style="font-family: Calibri; font-size: 11pt;">Main Heading 1</span></li>
</ol>
<p style="margin: 0pt 0pt 10pt 72pt; line-height: 115%; text-indent: -18pt; font-size: 11pt;"><span style="font-family: Calibri; font-size: 11pt;">1.</span><span style='font: 7pt/normal "Times New Roman"; font-size-adjust: none; font-stretch: normal;'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="font-family: Calibri; font-size: 11pt;">Item 1</span></p>
<p style="margin: 0pt 0pt 10pt 72pt; line-height: 115%; text-indent: -18pt; font-size: 11pt;"><span style="font-family: Calibri; font-size: 11pt;">2.</span><span style='font: 7pt/normal "Times New Roman"; font-size-adjust: none; font-stretch: normal;'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="font-family: Calibri; font-size: 11pt;">Item 2</span></p>
<p style="margin: 0pt 0pt 10pt 72pt; line-height: 115%; text-indent: -18pt; font-size: 11pt;"><span style="font-family: Calibri; font-size: 11pt;">3.</span><span style='font: 7pt/normal "Times New Roman"; font-size-adjust: none; font-stretch: normal;'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="font-family: Calibri; font-size: 11pt;">Item 3</span></p>
<ol type="A" style="margin-top: 0pt; margin-bottom: 0pt;" start="2">
<li style="line-height: 115%; font-size: 11pt; margin-top: 0pt; margin-bottom: 10pt;"><span style="font-family: Calibri; font-size: 11pt;">Main Heading 2</span></li>
</ol>
<p style="margin: 0pt 0pt 10pt 72pt; line-height: 115%; text-indent: -18pt; font-size: 11pt;"><span style="font-family: Calibri; font-size: 11pt;">1.</span><span style='font: 7pt/normal "Times New Roman"; font-size-adjust: none; font-stretch: normal;'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="font-family: Calibri; font-size: 11pt;">Item 1</span></p>
<p style="margin: 0pt 0pt 10pt 72pt; line-height: 115%; text-indent: -18pt; font-size: 11pt;"><span style="font-family: Calibri; font-size: 11pt;">2.</span><span style='font: 7pt/normal "Times New Roman"; font-size-adjust: none; font-stretch: normal;'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="font-family: Calibri; font-size: 11pt;">Item 2</span></p>
<p style="margin: 0pt 0pt 10pt 72pt; line-height: 115%; text-indent: -18pt; font-size: 11pt;"><span style="font-family: Calibri; font-size: 11pt;">3.</span><span style='font: 7pt/normal "Times New Roman"; font-size-adjust: none; font-stretch: normal;'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="font-family: Calibri; font-size: 11pt;">Item 3</span></p>

并粘贴到 extjs htmleditor 中,将其转换为

<ol style="list-style-type: upper-alpha; direction: ltr;">
<li style="color: rgb(0, 0, 0); font-style: normal; font-weight: normal;">
<p style="color: rgb(0, 0, 0); font-style: normal; font-weight: normal; margin-top: 0in; margin-bottom: 0pt; mso-list: l2 level1 lfo1;">Main
Heading 1
</p>
</li>
</ol>
<p><font face="Times New Roman" size="3">
<br></font>
</p>
<ol style="list-style-type: decimal; direction: ltr;">
<li style="color: rgb(0, 0, 0); font-style: normal; font-weight: normal;">
<p style="color: rgb(0, 0, 0); font-style: normal; font-weight: normal; margin-top: 0in; margin-bottom: 0pt; mso-list: l5 level1 lfo2; mso-add-space: auto;">Item
1
</p>
</li>
<li style='color: rgb(0, 0, 0); font-family: "Calibri","sans-serif"; font-size: 11pt; font-style: normal; font-weight: normal;'>
<p style='color: rgb(0, 0, 0); font-family: "Calibri","sans-serif"; font-size: 11pt; font-style: normal; font-weight: normal; margin-top: 0in; margin-bottom: 0pt; mso-list: l5 level1 lfo2; mso-add-space: auto;'>Item
2
</p>
</li>
<li style='color: rgb(0, 0, 0); font-family: "Calibri","sans-serif"; font-size: 11pt; font-style: normal; font-weight: normal;'>
<p style='color: rgb(0, 0, 0); font-family: "Calibri","sans-serif"; font-size: 11pt; font-style: normal; font-weight: normal; margin-top: 0in; margin-bottom: 0pt; mso-list: l5 level1 lfo2; mso-add-space: auto;'>Item
3
</p>
</li>
</ol>
<p><font face="Times New Roman" size="3">
<br></font>
</p>
<ol style="list-style-type: upper-alpha; direction: ltr;">
<li style="color: rgb(0, 0, 0); font-style: normal; font-weight: normal;">
<p style="color: rgb(0, 0, 0); font-style: normal; font-weight: normal; margin-top: 0in; margin-bottom: 0pt; mso-list: l2 level1 lfo1;">Main
Heading 2
</p>
</li>
</ol>
<p><font face="Times New Roman" size="3">
<br></font>
</p>
<ol style="list-style-type: decimal; direction: ltr;">
<li style="color: rgb(0, 0, 0); font-style: normal; font-weight: normal;">
<p style="color: rgb(0, 0, 0); font-style: normal; font-weight: normal; margin-top: 0in; margin-bottom: 0pt; mso-list: l7 level1 lfo3; mso-add-space: auto;">Item
1
</p>
</li>
<li style='color: rgb(0, 0, 0); font-family: "Calibri","sans-serif"; font-size: 11pt; font-style: normal; font-weight: normal;'>
<p style='color: rgb(0, 0, 0); font-family: "Calibri","sans-serif"; font-size: 11pt; font-style: normal; font-weight: normal; margin-top: 0in; margin-bottom: 0pt; mso-list: l7 level1 lfo3; mso-add-space: auto;'>Item
2
</p>
</li>
<li style='color: rgb(0, 0, 0); font-family: "Calibri","sans-serif"; font-size: 11pt; font-style: normal; font-weight: normal;'>
<p style='color: rgb(0, 0, 0); font-family: "Calibri","sans-serif"; font-size: 11pt; font-style: normal; font-weight: normal; margin-top: 0in; margin-bottom: 0pt; mso-list: l7 level1 lfo3; mso-add-space: auto;'>Item
3
</p>
</li>
</ol>

也请建议我这样做,以消除从 word 复制粘贴到编辑器时的格式问题

最佳答案

将word文档保存为html,复制/粘贴“Source Edit”中的html代码。

gif

view

<ol type="A" style="margin-top: 0pt; margin-bottom: 0pt;">
<li style="line-height: 115%; font-size: 11pt; margin-top: 0pt; margin-bottom: 10pt;"><span style="font-family: Calibri; font-size: 11pt;">Main Heading 1</span></li>
</ol>
<p style="margin: 0pt 0pt 10pt 72pt; line-height: 115%; text-indent: -18pt; font-size: 11pt;"><span style="font-family: Calibri; font-size: 11pt;">1.</span><span style='font: 7pt/normal "Times New Roman"; font-size-adjust: none; font-stretch: normal;'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="font-family: Calibri; font-size: 11pt;">Item 1</span></p>
<p style="margin: 0pt 0pt 10pt 72pt; line-height: 115%; text-indent: -18pt; font-size: 11pt;"><span style="font-family: Calibri; font-size: 11pt;">2.</span><span style='font: 7pt/normal "Times New Roman"; font-size-adjust: none; font-stretch: normal;'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="font-family: Calibri; font-size: 11pt;">Item 2</span></p>
<p style="margin: 0pt 0pt 10pt 72pt; line-height: 115%; text-indent: -18pt; font-size: 11pt;"><span style="font-family: Calibri; font-size: 11pt;">3.</span><span style='font: 7pt/normal "Times New Roman"; font-size-adjust: none; font-stretch: normal;'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="font-family: Calibri; font-size: 11pt;">Item 3</span></p>
<ol type="A" style="margin-top: 0pt; margin-bottom: 0pt;" start="2">
<li style="line-height: 115%; font-size: 11pt; margin-top: 0pt; margin-bottom: 10pt;"><span style="font-family: Calibri; font-size: 11pt;">Main Heading 2</span></li>
</ol>
<p style="margin: 0pt 0pt 10pt 72pt; line-height: 115%; text-indent: -18pt; font-size: 11pt;"><span style="font-family: Calibri; font-size: 11pt;">1.</span><span style='font: 7pt/normal "Times New Roman"; font-size-adjust: none; font-stretch: normal;'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="font-family: Calibri; font-size: 11pt;">Item 1</span></p>
<p style="margin: 0pt 0pt 10pt 72pt; line-height: 115%; text-indent: -18pt; font-size: 11pt;"><span style="font-family: Calibri; font-size: 11pt;">2.</span><span style='font: 7pt/normal "Times New Roman"; font-size-adjust: none; font-stretch: normal;'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="font-family: Calibri; font-size: 11pt;">Item 2</span></p>
<p style="margin: 0pt 0pt 10pt 72pt; line-height: 115%; text-indent: -18pt; font-size: 11pt;"><span style="font-family: Calibri; font-size: 11pt;">3.</span><span style='font: 7pt/normal "Times New Roman"; font-size-adjust: none; font-stretch: normal;'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="font-family: Calibri; font-size: 11pt;">Item 3</span></p>

关于javascript - 从 word 粘贴到 extjs 编辑器,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38850630/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com