portals-jetspeed-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From wea...@apache.org
Subject cvs commit: jakarta-jetspeed/src/java/org/apache/jetspeed/util/rewriter SwingParserAdaptor.java
Date Mon, 04 Oct 2004 20:36:12 GMT
weaver      2004/10/04 13:36:11

  Modified:    src/java/org/apache/jetspeed/util/rewriter
                        SwingParserAdaptor.java
  Log:
  Fix for JS1-521 & 522.
  
  Revision  Changes    Path
  1.8       +22 -3     jakarta-jetspeed/src/java/org/apache/jetspeed/util/rewriter/SwingParserAdaptor.java
  
  Index: SwingParserAdaptor.java
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed/src/java/org/apache/jetspeed/util/rewriter/SwingParserAdaptor.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- SwingParserAdaptor.java	31 Aug 2004 19:00:38 -0000	1.7
  +++ SwingParserAdaptor.java	4 Oct 2004 20:36:11 -0000	1.8
  @@ -118,6 +118,7 @@
           private boolean simpleTag = false;
   
           private StringWriter result = new StringWriter();
  +        private Stack impliedTags = new Stack();
   
           private Callback () 
           {
  @@ -154,6 +155,12 @@
            */
           public void handleSimpleTag(HTML.Tag tag,MutableAttributeSet attrs,int param) 
           {
  +            //skip _implied_ tags
  +            if(attrs.containsAttribute("_implied_", new Boolean(true)))
  +            {
  +                return;
  +            }
  +            
               simpleTag = true;
               if (false == rewriter.enterSimpleTagEvent(tag, attrs))
                   return;
  @@ -184,6 +191,13 @@
            */
           public void handleStartTag(HTML.Tag tag,  MutableAttributeSet attrs, int position)

           {
  +            //  skip _implied_ tags
  +            if(attrs.containsAttribute("_implied_", new Boolean(true)))
  +            {
  +                impliedTags.push(tag);
  +                return;
  +            }
  +            
               if (false == rewriter.enterStartTagEvent(tag, attrs))
                   return;
   
  @@ -238,6 +252,12 @@
            */
           public void handleEndTag(HTML.Tag tag, int position) 
           {
  +            if(impliedTags.peek() == (tag))
  +            {
  +                impliedTags.pop();
  +                return;
  +            }
  +            
               if (false == rewriter.enterEndTagEvent(tag))
                   return;
   
  @@ -250,8 +270,6 @@
              if (false == isValidFragmentTag(tag))
                   return;
   
  -           addToResult("</").addToResult(tag).addToResult(">");
  -
               formatLine(tag);
               String appended = rewriter.exitEndTagEvent(tag);
               if (null != appended)
  @@ -403,6 +421,7 @@
            */
           private void appendTagToResult(HTML.Tag tag, MutableAttributeSet attrs) 
           {
  +                       
               convertURLS(tag,attrs);
               Enumeration e = attrs.getAttributeNames();
               addToResult("<").addToResult(tag);
  
  
  

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


Mime
View raw message