【发布时间】:2019-10-22 10:00:49
【问题描述】:
我有一个示例 html,我想在下面使用 html 敏捷包删除评论标签中的所有 span 标签
<comment id="e096f3920ecbd8378f2b77b9608588434" type="start"></comment>
<span style="color:hsl(0,0%,0%);">
<span style="color:hsl(0,0%,0%);">
Microsoft
</span>
</span>
<comment id="e096f3920ecbd8378f2b77b9608588434" type="end"></comment>
这个 html 是由 ckeditor 自动生成的,它的评论标签有类型(start 和 end)。是否可以使用 html 敏捷包从开始到结束的评论标签中删除一些标签?
更新问题(2019 年 10 月 24 日)
完整的 HTML(由 ckeditor 提供)
<p>
<span style="color:hsl(0,0%,0%);">
<span style="color:hsl(0,0%,0%);">
<span style="color:hsl(0,0%,0%);">
<span style="color:hsl(0,0%,0%);">
<span style="color:hsl(0,0%,0%);">
<span style="color:hsl(0,0%,0%);">
<span style="color:hsl(0,0%,0%);">
<comment id="ef7492a2e61d2666914b6a947aef5a6d6" type="start"></comment>
<span style="color:hsl(0,0%,0%);">This </span>
</span>
</span>
</span>
</span>
</span>
</span>
<comment id="e042cfd52178aaa260f79e1accd66441c" type="start"></comment>
Microsoft
<comment id="e042cfd52178aaa260f79e1accd66441c" type="end"></comment>
<span style="color:hsl(0,0%,0%);">
<span style="color:hsl(0,0%,0%);">
<span style="color:hsl(0,0%,0%);">
<span style="color:hsl(0,0%,0%);">
<span style="color:hsl(0,0%,0%);">
<span style="color:hsl(0,0%,0%);">
<span style="color:hsl(0,0%,0%);">Enterprise</span>
<comment id="ef7492a2e61d2666914b6a947aef5a6d6" type="end"></comment>
<span style="color:hsl(0,0%,0%);"> Agreement is entered into between the entities identified on the signature form.</span>
</span>
</span>
</span>
</span>
</span>
</span>
</span>
</p>
我想删除 comment start id (ef7492a2e61d2666914b6a947aef5a6d6) 和 comment end id (ef7492a2e61d2666914b6a947aef5a6d6)
内的所有跨度【问题讨论】:
标签: c# html html-parsing html-agility-pack ckeditor5