Forums / Developer / Problems with <p> tag / Comment39648
Marco Zinn
Saturday 17 January 2004 1:27:19 am
Hi, well, you intro field is XML, so, depending on the content, you will run into more problems, when some HTML-Structure is not complete after 100 chars. Option 1: Do not use an XML-Field, but a text field for the intro. Option 2: Try to get rid of the HTML-Tags before you "shorten" the text. MAYBE the "wash" opertor will do it, but i'm not sure. Try {$:item.data_map.resource_introduction.data_text|wash|shorten(100)} and see, what happens. Look at the HTML-source of your page. Note: If this works, it will remove all HTML-Tags and formatting (such as bold, links, tables).The other option would be to enhance the "shorten" operator to keep track of open HTML-Tags and close them, before returning the result. But i think, the operator cannot do this and there is no such operator (yet).
Marco http://www.hyperroad-design.com