简体   繁体   English

批量删除标签 * VS 代码中的标签内容

[英]Bulk remove tags * tag content in VS code

I am translating a document from word to HTML - this is painful... however I have found a way to speed this up, but it has left my HTML very chunky ie我正在将文档从 word 翻译成 HTML - 这很痛苦......但是我找到了一种加快速度的方法,但它使我的 HTML 变得非常笨拙,即

<p class="MsoNormal" align="left" style="margin-top:0cm;margin-right:0cm;
        margin-bottom:12.0pt;margin-left:0cm;text-align:left;text-indent:0cm;
        line-height:115%;vertical-align:baseline"><span lang="EN-GB">To comply with any
        legal or regulatory requirements.</span></p>

Ugly as sin right....丑得像罪过吧....

So what I am wondering is:所以我想知道的是:

In VS code is there a way to select large amounts of html ie在 VS 代码中有一种方法可以选择大量的 html,即

在此处输入图片说明

And then run a command via the command pallet, or search and replace to say.然后通过命令托盘运行命令,或者搜索替换说。

Remove the style attribute and all of the content instead of it?删除样式属性和所有内容而不是它?

-- ——

Im sure this must have been asked before but have not found a way to do this and am trying to work smarter not harder.我确定这之前一定有人问过,但还没有找到办法做到这一点,我正在努力更聪明地工作,而不是更努力地工作。

Thanks - W谢谢-W

So the first thing I would do, noting your final thought there that this must have been answered would be to do a cursory search on SO before posting.所以我会做的第一件事,注意到你在那里的最后一个想法,这一定已经得到了回答,那就是在发布之前对 SO 进行粗略的搜索。 But since it's here, the easiest way I have found is to either use the MS Word's own export functionality to HTML:但是因为它在这里,我发现的最简单的方法是使用 MS Word 自己的导出功能到 HTML:

Go to the file menu.转到文件菜单。 Select Save as.选择另存为。 In the drop-down file type box select, Web Page, Filtered.在下拉文件类型框中选择网页、已过滤。 Click Save.单击保存。

If that does not produce the output you want, there are free services online where you can paste rich content and have the app rewrite it for you in html, such as this site: https://wordtohtml.net/如果这不能产生您想要的输出,在线提供免费服务,您可以在其中粘贴丰富的内容并让应用程序为您重写 html,例如此站点: https : //wordtohtml.net/

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM