[jboss-cvs] jboss-seam/examples/wiki/src/main/org/jboss/seam/wiki/core/search/metamodel ...

Christian Bauer christian at hibernate.org
Fri Nov 9 10:08:25 EST 2007


  User: cbauer  
  Date: 07/11/09 10:08:25

  Modified:    examples/wiki/src/main/org/jboss/seam/wiki/core/search/metamodel 
                        SearchSupport.java
  Log:
  Various updates to core classes and views, required for forum plugin
  
  Revision  Changes    Path
  1.4       +11 -7     jboss-seam/examples/wiki/src/main/org/jboss/seam/wiki/core/search/metamodel/SearchSupport.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: SearchSupport.java
  ===================================================================
  RCS file: /cvsroot/jboss/jboss-seam/examples/wiki/src/main/org/jboss/seam/wiki/core/search/metamodel/SearchSupport.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -b -r1.3 -r1.4
  --- SearchSupport.java	30 Aug 2007 16:51:00 -0000	1.3
  +++ SearchSupport.java	9 Nov 2007 15:08:25 -0000	1.4
  @@ -85,22 +85,26 @@
               String unescapedFragements =
                       highlighter.getBestFragments(tokenStream, indexedText, numOfFragments, getFragmentSeparator());
   
  -            String escapedFragments = WikiUtil.escapeHtml(unescapedFragements, false);
  +            String escapedFragments = WikiUtil.escapeHtml(WikiUtil.removeMacros(unescapedFragements), false);
   
               // .. and then replace the internal placeholders with real tags after HTML has been escaped
               escapedFragments = escapedFragments.replaceAll(INTERNAL_BEGIN_HIT, getBeginHitTag());
               escapedFragments = escapedFragments.replaceAll(INTERNAL_END_HIT, getEndHitTag());
   
  +            // Strip out macros
  +
               // If no fragments were produced (no hits), return the original text as an alternative
               if (escapedFragments.length() == 0 && alternativeLength != 0) {
                   return WikiUtil.escapeHtml(
  +                        WikiUtil.removeMacros(
                       indexedText.substring(
                           0,
                           indexedText.length()>alternativeLength ? alternativeLength : indexedText.length()
  +                            )
                       ), false
                   );
               } else if (escapedFragments.length() == 0 && alternativeLength == 0){
  -                return WikiUtil.escapeHtml(indexedText, false);
  +                return WikiUtil.escapeHtml(WikiUtil.removeMacros(indexedText), false);
               }
   
               return escapedFragments;
  
  
  



More information about the jboss-cvs-commits mailing list