简体   繁体   English

HTML ASP.Net MVC中未关闭的标签

[英]unclosed tags in html ASP.Net MVC

i have a description of a product who fill by ckeditor. 我对ckeditor填充的产品进行了描述。 i show a part of the description on the page. 我在页面上显示了一部分描述。 the problem is that they create a problem. 问题是他们制造了一个问题。

suppose ckeditor created <p>blahblah</p> and i cut the text to the limit code have then logically p tag is not closed. 假设ckeditor创建了<p>blahblah</p>并且我将文本剪切到了限制代码,然后逻辑上p标签没有关闭。 so here is something i can do. 所以这是我能做的。

close the tag. 关闭标签。 are i can get the text from them and append inside the div i create. 我可以从中获取文本并附加到我创建的div中吗? well how i can do that. 以及我该怎么做。

So the issues is that you need to display a excerpt of the full description? 因此,问题在于您需要显示完整描述的摘录? Is it feasible, in that case, to just strip HTML and just display a certain amount of characters? 在那种情况下,仅剥离HTML并仅显示一定数量的字符是否可行?

如果您需要从html提取文本或修复html,则可以尝试使用HTML Agility Pack

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

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