Issue 12018

Freemarker common.limit macro must respect html tags

12018
Reporter: mdoering
Assignee: mdoering
Type: Bug
Summary: Freemarker common.limit macro must respect html tags
Priority: Critical
Resolution: Fixed
Status: Closed
Created: 2012-10-12 14:03:47.535
Updated: 2013-08-29 14:45:02.271
Resolved: 2012-10-29 18:39:02.656
        
Description: The common.limit macro we have is used to limit text to a certain length and if exceeding cuts it off while adding an ellipse to the end.
Some of the text we limit can contain html tags though, e.g. the highlighted areas in a search. It happens that the limit macro breaks some html tags and ruins an entire html page.
For example see Abies sibirica here: http://staging.gbif.org:8080/portal-web-dynamic/species/search?q=abies&dataset_key=nub

The limit macro should respect xml tags and maybe count opening and closing brackets and make sure it only cuts of text when outside of simple tags?
Or should this be better done with some custom jsp tag library?]]>
    


Author: mdoering@gbif.org
Created: 2012-10-29 18:39:02.689
Updated: 2012-10-29 18:39:02.689
        
http://code.google.com/p/gbif-portal/source/detail?r=1123

macro is unchanged and instead the static getHighlightedText() method in the BaseSearchAction modified to respect tags