[prev in list] [next in list] [prev in thread] [next in thread] 

List:       lucene-dev
Subject:    [jira] Closed: (LUCENE-340) [PATCH] Highlighter: Delegate output escaping to Formatter
From:       "Erik Hatcher (JIRA)" <jira () apache ! org>
Date:       2005-09-23 11:10:30
Message-ID: 605972511.1127473830609.JavaMail.jira () ajax ! apache ! org
[Download RAW message or body]

     [ http://issues.apache.org/jira/browse/LUCENE-340?page=all ]
     
Erik Hatcher closed LUCENE-340:
-------------------------------

    Resolution: Fixed
     Assign To:     (was: Lucene Developers)

> [PATCH] Highlighter: Delegate output escaping to Formatter
> ----------------------------------------------------------
> 
> Key: LUCENE-340
> URL: http://issues.apache.org/jira/browse/LUCENE-340
> Project: Lucene - Java
> Type: Improvement
> Components: Other
> Versions: CVS Nightly - Specify date in submission
> Environment: Operating System: Windows XP
> Platform: PC
> Reporter: Nicko Cadell
> Priority: Minor
> Attachments: DefaultEncoder.java, Encoder.java, SimpleHTMLEncoder.java, \
> TextOutputEscaping.diff, UpdateToUseEncoder.diff 
> Patch for jakarta-lucene-sandbox/contributions/highlighter
> CVS version 3rd February 2005
> This patch allows the highlighter Formatter to control escaping of the non
> highlighted text as well as the highlighting of the matching text.
> The example formatters highlight the matching text using XML/HTML tags. This
> works fine if the plain text does not contain any characters that need to be
> escaped for HTML output (i.e. <, &, and "), however this cannot be guaranteed.
> As the formatter controls the method of highlighting (in the examples this is
> HTML, but it could be any other form of markup) it should also be responsible
> for escaping the rest of the output.
> This patch adds a method, encodeText(String), to the Formatter interface. This
> is a breaking change. This method is called from the Highlighter with the text
> that is not passed to the formatter's highlightTerm method. 
> The SimpleHTMLFormatter has a public static method for performing simple HTML
> escaping called htmlEncode. 
> The SimpleHTMLFormatter, GradientFormatter, and SpanGradientFormatter have been
> updated to implement the encodeText method and call the htmlEncode method to
> escape the output.
> For existing formatter to maintain exactly the same behaviour as before applying
> this patch they would need to implement the encodeText method to return the
> argument value without modification, e.g.:
> public String encodeText(String originalText)
> {
> return originalText;
> }

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-dev-help@lucene.apache.org


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic