michael-o commented on code in PR #114:
URL: https://github.com/apache/maven-doxia/pull/114#discussion_r938158983


##########
doxia-core/src/main/java/org/apache/maven/doxia/sink/impl/Xhtml5BaseSink.java:
##########
@@ -1621,29 +1503,6 @@ private void tableCell( boolean headerRow, 
MutableAttributeSet attributes )
     {
         Tag t = ( headerRow ? HtmlMarkup.TH : HtmlMarkup.TD );
 
-        if ( !headerRow && cellCountStack != null && !cellCountStack.isEmpty()
-            && cellJustifStack != null && !cellJustifStack.isEmpty() && 
getCellJustif() != null )
-        {
-            int cellCount = getCellCount();
-            if ( cellCount < getCellJustif().length )
-            {
-                Map<Integer, MutableAttributeSet> hash = new HashMap<>();
-                hash.put( Sink.JUSTIFY_CENTER, SinkEventAttributeSet.CENTER );
-                hash.put( Sink.JUSTIFY_LEFT, SinkEventAttributeSet.LEFT );
-                hash.put( Sink.JUSTIFY_RIGHT, SinkEventAttributeSet.RIGHT );
-                MutableAttributeSet atts = hash.get( 
getCellJustif()[cellCount] );
-
-                if ( attributes == null )
-                {
-                    attributes = new SinkEventAttributeSet();
-                }
-                if ( atts != null )
-                {
-                    attributes.addAttributes( atts );
-                }
-            }
-        }

Review Comment:
   Looking into this one..



##########
doxia-core/src/main/java/org/apache/maven/doxia/parser/Xhtml5BaseParser.java:
##########
@@ -1218,26 +1212,13 @@ private void handleSectionEnd( Sink sink )
     private void handleTableStart( Sink sink, SinkEventAttributeSet attribs, 
XmlPullParser parser )
     {
         sink.table( attribs );
-        String border = parser.getAttributeValue( null, 
Attribute.BORDER.toString() );
-        boolean grid = true;
-
-        if ( border == null || "0".equals( border ) )
+        String givenTableClass = parser.getAttributeValue( null, 
Attribute.CLASS.toString() );
+        boolean grid = false;
+        if ( givenTableClass != null && BODYTABLEBORDER_CLASS_PATTERN.matcher( 
givenTableClass ).matches() )
         {
-            grid = false;
+            grid = true;
         }
-
-        String align = parser.getAttributeValue( null, 
Attribute.ALIGN.toString() );
-        int[] justif = {Sink.JUSTIFY_LEFT};
-
-        if ( "center".equals( align ) )
-        {
-            justif[0] = Sink.JUSTIFY_CENTER;
-        }
-        else if ( "right".equals( align ) )
-        {
-            justif[0] = Sink.JUSTIFY_RIGHT;
-        }
-
-        sink.tableRows( justif, grid );
+        sink.tableRows( new int[0], grid );

Review Comment:
   @hboutemy The only way to solve this here is to get the `style` from the 
table and try to read for `text-align: {value}` and convert. It will not cover 
any CSS



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscr...@maven.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to