Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo


#100 GSearch: let highlight code be configurable.


GSearch: let highlight code be configurable.

Ahmed Abdeen: "Snippets: We probably all agree that it is desirable to highlight searchterms in display of a search result. Specifying a value > 0 in the gFindObjects' "snippetsMax" parameter is intended to make this happen. In particular, use of this parameter causes gsearch to surround search terms in all DC metdata with <span class-"highlight"> tags (and highlighting can then be enabled by defining a CSS class to apply desired formatting). This is problematic insofar as introduction of unescaped XML tags into the data changes the XML structure and therefore how the data can be handled by XSLT."
"our metadata includes the usual XML escaped characters, including such characters used for formatting tags – for example, "<em>emphasized text</em>" is encoded in the DC metdata as "&lt;em&gt;ehphasized text&lt;/em&gt;". To display these appropriately in a web context, the string must be processed with output escaping disabled .... When you have a string such as this:

<field name="dc.description" >This is some <span class="highlight">emphasized</span> &lt;em&gt;text&lt;/em&gt; in a sentence.< /field >

You have to use xsl:copy-of to appropriately output the <span> tags … but you cannot disable output escaping to have the escaped <em> tags display properly. Ugh."

The solution seems to be to make the surrounding highlight code be configurable.


  • fcswa

    • status: open --> closed