Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
嗨, 我正在创建自定义 CMS。在主页上,我想要一个所有文章的列表,显示文章的前 80 个单词。我试图弄清楚如何获得文章预览。
问题是如果我把它剪到一个<a>标签的中间(所以它看起来像这样<a href="blahblah">...[closing tag is cut off]:),页面的其余部分将被视为链接的内容。
<a>
<a href="blahblah">...[closing tag is cut off]
如何处理?
您可以维护到目前为止看到的一堆开始标签,然后在修剪摘要完成时弹出相应的结束标签。