MSWORD文档中的文本,当您剪切和粘贴一个Word文档到文档HTMT(具体为contenteditable
格)我注意到它包含了很多的元数据。我感兴趣的是一个JavaScript函数,可以将这些文本分页成多个div,因为它们是word文档中的“页面”。分页与JavaScript
如果你不熟悉,这里的word文档的样子从查看源代码的缩写版本:
<div contenteditable="true" >
<!--[if gte mso 9]><xml>
<o:OfficeDocumentSettings>
<o:AllowPNG/>
</o:OfficeDocumentSettings>
</xml><![endif]-->
<!--lots more junk until get to actual content which is here:-->
<p class="Default">
<b><span style="font-size:14.0pt;font-family:Arial;color:windowtext">
I am the actual title of this work. <o:p></o:p></span>
</b>
</p>
谢谢,是的解决方案可能是基于字符数或一些元数据标签,不知道... –
嗨@LukeGT,感谢您的进一步解释,我想我的概念理解,而不是代码的外观,你可以对此采取一些措施吗? –
当然,看看我的编辑快速模拟 – LukeGT