[ https://issues.apache.org/jira/browse/DOXIA-590?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17553146#comment-17553146 ]
ASF GitHub Bot commented on DOXIA-590: -------------------------------------- michael-o commented on code in PR #104: URL: https://github.com/apache/maven-doxia/pull/104#discussion_r895056477 ########## doxia-core/src/test/java/org/apache/maven/doxia/sink/impl/Xhtml5BaseSinkTest.java: ########## @@ -1086,15 +1086,86 @@ public void testTableRow() { sink = new Xhtml5BaseSink( writer ); + sink.tableRows( null, false ); + sink.tableRow( attributes ); + sink.tableRow_(); + sink.tableRow(); + sink.tableRow_(); + sink.tableRows_(); + sink.table_(); + } + finally + { + sink.close(); + } + + String nl = System.lineSeparator(); + String xmlExpected = "<table border=\"0\" class=\"bodyTable\">" + nl + "<tr style=\"bold\" class=\"a\"></tr>" + + nl + "<tr class=\"b\"></tr></table>"; + + assertEquals( xmlExpected, writer.toString() ); + } + + /** + * Test striping for hidden rows in tableRow method. + */ + @Test + public void testHiddenTableRowStriping() + { + try + { + SinkEventAttributeSet attributes2 = new SinkEventAttributeSet(); + SinkEventAttributeSet attributes3 = new SinkEventAttributeSet(); + attributes3.addAttributes( attributes ); + sink = new Xhtml5BaseSink( writer ); + + sink.tableRow(); + sink.tableRow_(); sink.tableRow( attributes ); sink.tableRow_(); + attributes2.addAttribute( SinkEventAttributes.CLASS, "hidden xyz abc" ); + sink.tableRow( attributes2 ); + sink.tableRow_(); + attributes2.addAttribute( SinkEventAttributes.CLASS, "abc hidden xyz" ); + sink.tableRow( attributes2 ); + sink.tableRow_(); + sink.tableRow(); + sink.tableRow_(); + attributes2.addAttribute( SinkEventAttributes.CLASS, "not-hidden xyz" ); + sink.tableRow( attributes2 ); + sink.tableRow_(); + attributes2.addAttribute( SinkEventAttributes.CLASS, "xyz not-hidden" ); + sink.tableRow( attributes2 ); + sink.tableRow_(); + attributes3.addAttribute( SinkEventAttributes.CLASS, "xyz abc hidden" ); + sink.tableRow( attributes3 ); + sink.tableRow_(); + attributes2.addAttribute( SinkEventAttributes.CLASS, "xyz hidden-not" ); + sink.tableRow( attributes2 ); + sink.tableRow_(); + sink.tableRow(); + sink.tableRow_(); } finally { sink.close(); } - assertEquals( "<tr style=\"bold\" class=\"a\"></tr>", writer.toString() ); + String nl = System.lineSeparator(); Review Comment: Use provided `LS` ########## doxia-core/src/test/java/org/apache/maven/doxia/sink/impl/Xhtml5BaseSinkTest.java: ########## @@ -1086,15 +1086,86 @@ public void testTableRow() { sink = new Xhtml5BaseSink( writer ); + sink.tableRows( null, false ); + sink.tableRow( attributes ); + sink.tableRow_(); + sink.tableRow(); + sink.tableRow_(); + sink.tableRows_(); + sink.table_(); + } + finally + { + sink.close(); + } + + String nl = System.lineSeparator(); Review Comment: Use provided `LS` > Either provided element class or default class gets ignored > ----------------------------------------------------------- > > Key: DOXIA-590 > URL: https://issues.apache.org/jira/browse/DOXIA-590 > Project: Maven Doxia > Issue Type: Bug > Components: Core > Affects Versions: 1.8 > Reporter: Fred Eckertson > Assignee: Michael Osipov > Priority: Major > Fix For: 2.0.0-M3, 1.11.2 > > Attachments: image-2022-05-18-21-57-40-619.png > > > The following construct is somewhat common in doxia-core > att.addAttribute( Attribute.CLASS, "a" ); > The documentation says that basic attributes (including CLASS) are supported. > However in cases like this either that "a" or the CLASS that was provided in > the attributes parameter will be ignored. The correct way to do this is to > append the provided CLASS to "a " if a CLASS attribute was provided. -- This message was sent by Atlassian Jira (v8.20.7#820007)