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.
我有 HTML 标记字符串以及在它之间写入的普通文本,我想做的是删除除超链接和换行符之外的所有 HTML 标记,以便它看起来像普通的记事本样式文本但已格式化(即带有换行符,所以它仍然存在可读)和超链接,以确保所有外部链接仍然可见,供用户点击。
我尝试了一些正则表达式解决方案,但它们完全消除了我不想要的所有 HTML 标记。
谢谢。
使用Html 敏捷包。它似乎对您的问题有用。