From doxia-commits-return-1157-apmail-maven-doxia-commits-archive=maven.apache.org@maven.apache.org Fri Nov 07 21:08:54 2008 Return-Path: Delivered-To: apmail-maven-doxia-commits-archive@www.apache.org Received: (qmail 41600 invoked from network); 7 Nov 2008 21:08:54 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 7 Nov 2008 21:08:54 -0000 Received: (qmail 37023 invoked by uid 500); 7 Nov 2008 21:09:01 -0000 Delivered-To: apmail-maven-doxia-commits-archive@maven.apache.org Received: (qmail 36997 invoked by uid 500); 7 Nov 2008 21:09:01 -0000 Mailing-List: contact doxia-commits-help@maven.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: doxia-dev@maven.apache.org Delivered-To: mailing list doxia-commits@maven.apache.org Received: (qmail 36988 invoked by uid 99); 7 Nov 2008 21:09:01 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 07 Nov 2008 13:09:01 -0800 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 07 Nov 2008 21:07:51 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 8352A2388975; Fri, 7 Nov 2008 13:08:33 -0800 (PST) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r712263 - /maven/doxia/doxia/trunk/doxia-core/src/main/java/org/apache/maven/doxia/sink/XhtmlBaseSink.java Date: Fri, 07 Nov 2008 21:08:33 -0000 To: doxia-commits@maven.apache.org From: vsiveton@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20081107210833.8352A2388975@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: vsiveton Date: Fri Nov 7 13:08:33 2008 New Revision: 712263 URL: http://svn.apache.org/viewvc?rev=712263&view=rev Log: DOXIA-264: XhtmlBaseSink and sub classes should create a valid XHTML o be sure that p is not write for list, verbatim and table Modified: maven/doxia/doxia/trunk/doxia-core/src/main/java/org/apache/maven/doxia/sink/XhtmlBaseSink.java Modified: maven/doxia/doxia/trunk/doxia-core/src/main/java/org/apache/maven/doxia/sink/XhtmlBaseSink.java URL: http://svn.apache.org/viewvc/maven/doxia/doxia/trunk/doxia-core/src/main/java/org/apache/maven/doxia/sink/XhtmlBaseSink.java?rev=712263&r1=712262&r2=712263&view=diff ============================================================================== --- maven/doxia/doxia/trunk/doxia-core/src/main/java/org/apache/maven/doxia/sink/XhtmlBaseSink.java (original) +++ maven/doxia/doxia/trunk/doxia-core/src/main/java/org/apache/maven/doxia/sink/XhtmlBaseSink.java Fri Nov 7 13:08:33 2008 @@ -60,6 +60,9 @@ /** An indication on if we're inside an image caption flag. */ private boolean figureCaptionFlag; + /** An indication on if we're inside a paragraph flag. */ + private boolean paragraphFlag; + /** An indication on if we're in verbatim mode. */ private boolean verbatimFlag; @@ -484,6 +487,14 @@ */ public void list() { + if ( paragraphFlag ) + { + // The content of element type "p" must match + // "(a|br|span|bdo|object|applet|img|map|iframe|tt|i|b|u|s|strike|big|small|font|basefont|em|strong| + // dfn|code|q|samp|kbd|var|cite|abbr|acronym|sub|sup|input|select|textarea|label|button|ins|del|script)". + paragraph_(); + } + writeStartTag( Tag.UL ); } @@ -557,6 +568,14 @@ */ public void numberedList( int numbering, SinkEventAttributes attributes ) { + if ( paragraphFlag ) + { + // The content of element type "p" must match + // "(a|br|span|bdo|object|applet|img|map|iframe|tt|i|b|u|s|strike|big|small|font|basefont|em|strong| + // dfn|code|q|samp|kbd|var|cite|abbr|acronym|sub|sup|input|select|textarea|label|button|ins|del|script)". + paragraph_(); + } + String style; switch ( numbering ) { @@ -635,6 +654,14 @@ */ public void definitionList() { + if ( paragraphFlag ) + { + // The content of element type "p" must match + // "(a|br|span|bdo|object|applet|img|map|iframe|tt|i|b|u|s|strike|big|small|font|basefont|em|strong| + // dfn|code|q|samp|kbd|var|cite|abbr|acronym|sub|sup|input|select|textarea|label|button|ins|del|script)". + paragraph_(); + } + writeStartTag( Tag.DL ); } @@ -644,6 +671,14 @@ */ public void definitionList( SinkEventAttributes attributes ) { + if ( paragraphFlag ) + { + // The content of element type "p" must match + // "(a|br|span|bdo|object|applet|img|map|iframe|tt|i|b|u|s|strike|big|small|font|basefont|em|strong| + // dfn|code|q|samp|kbd|var|cite|abbr|acronym|sub|sup|input|select|textarea|label|button|ins|del|script)". + paragraph_(); + } + MutableAttributeSet atts = SinkUtils.filterAttributes( attributes, SinkUtils.SINK_BASE_ATTRIBUTES ); @@ -872,6 +907,8 @@ */ public void paragraph() { + paragraphFlag = true; + writeStartTag( Tag.P ); } @@ -881,6 +918,8 @@ */ public void paragraph( SinkEventAttributes attributes ) { + paragraphFlag = true; + MutableAttributeSet atts = SinkUtils.filterAttributes( attributes, SinkUtils.SINK_SECTION_ATTRIBUTES ); @@ -893,7 +932,11 @@ */ public void paragraph_() { - writeEndTag( Tag.P ); + if ( paragraphFlag ) + { + writeEndTag( Tag.P ); + paragraphFlag = false; + } } /** @@ -905,6 +948,14 @@ */ public void verbatim( boolean boxed ) { + if ( paragraphFlag ) + { + // The content of element type "p" must match + // "(a|br|span|bdo|object|applet|img|map|iframe|tt|i|b|u|s|strike|big|small|font|basefont|em|strong| + // dfn|code|q|samp|kbd|var|cite|abbr|acronym|sub|sup|input|select|textarea|label|button|ins|del|script)". + paragraph_(); + } + SinkEventAttributeSet att = new SinkEventAttributeSet(); if ( boxed ) @@ -924,6 +975,14 @@ */ public void verbatim( SinkEventAttributes attributes ) { + if ( paragraphFlag ) + { + // The content of element type "p" must match + // "(a|br|span|bdo|object|applet|img|map|iframe|tt|i|b|u|s|strike|big|small|font|basefont|em|strong| + // dfn|code|q|samp|kbd|var|cite|abbr|acronym|sub|sup|input|select|textarea|label|button|ins|del|script)". + paragraph_(); + } + verbatimFlag = true; MutableAttributeSet atts = SinkUtils.filterAttributes( @@ -1003,6 +1062,14 @@ /** {@inheritDoc} */ public void table() { + if ( paragraphFlag ) + { + // The content of element type "p" must match + // "(a|br|span|bdo|object|applet|img|map|iframe|tt|i|b|u|s|strike|big|small|font|basefont|em|strong| + // dfn|code|q|samp|kbd|var|cite|abbr|acronym|sub|sup|input|select|textarea|label|button|ins|del|script)". + paragraph_(); + } + // start table with tableRows table( null ); } @@ -1010,6 +1077,14 @@ /** {@inheritDoc} */ public void table( SinkEventAttributes attributes ) { + if ( paragraphFlag ) + { + // The content of element type "p" must match + // "(a|br|span|bdo|object|applet|img|map|iframe|tt|i|b|u|s|strike|big|small|font|basefont|em|strong| + // dfn|code|q|samp|kbd|var|cite|abbr|acronym|sub|sup|input|select|textarea|label|button|ins|del|script)". + paragraph_(); + } + tableWriter = new StringWriter(); // start table with tableRows @@ -1716,7 +1791,6 @@ // // ---------------------------------------------------------------------- - /** * Write HTML escaped text to output. *