我试图找出一种方法来缩短可能包含链接的正文。
<div class="bio">
Banjo my soundcloud is <a href="http://soundcloud.com/username">http://soundcloud.com/username</a>
Echo Park kale chips blog, cred pitchfork keffiyeh mixtape tumblr photo booth artisan helvetica
meggings fashion axe roof party. Aesthetic biodiesel direct trade butcher, iPhone occupy before
they sold out trust fund mumblecore cornhole food truck DIY narwhal freegan. Salvia try-hard
freegan, Brooklyn Marfa craft beer fanny pack dreamcatcher High Life irony sriracha. Mumblecore
Terry Richardson ethnic, pop-up tattooed sartorial 3 wolf moon banjo biodiesel church-key semiotics
polaroid Etsy Schlitz hashtag. Wes Anderson gluten-free lomo brunch, raw denim plaid Schlitz salvia.
</div>
我最初尝试通过截断字符数来缩短文本正文,然后我将插入一个“更多”链接,将其余文本放在一个跨度中,然后隐藏跨度直到单击“更多”链接。但是,如果用户决定将链接放在错误的位置,插入“更多”链接会破坏用户放置的锚标记。
这是我为这个问题找到的不起作用的解决方案:http : //www.bookofzeus.com/articles/dynamically-shortened-text-using-jquery/
缩短可能包含锚标签的正文的好方法是什么?