[ 
https://issues.apache.org/jira/browse/DOXIA-668?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17575407#comment-17575407
 ] 

ASF GitHub Bot commented on DOXIA-668:
--------------------------------------

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





> Remove all obsolete attributes in HTML5
> ---------------------------------------
>
>                 Key: DOXIA-668
>                 URL: https://issues.apache.org/jira/browse/DOXIA-668
>             Project: Maven Doxia
>          Issue Type: Sub-task
>          Components: Module - Xhtml
>            Reporter: Michael Osipov
>            Assignee: Michael Osipov
>            Priority: Major
>             Fix For: 2.0.0-M4
>
>
> This listing provides all obsolete elements along with obsolete attributes 
> per element: 
> [https://www.tutorialrepublic.com/html-reference/html5-tags.php|https://www.tutorialrepublic.com/html-reference/html5-tags.php].
> We will remove attribute definitions in Sink and Parser (XHTML5 and derived 
> like Xdoc and FML). Moreover these changes will break some usage:
> * Aligning of table cell must now happen through CSS on the TDs rather than 
> providing it to table rows. There is no simple way to parse and write it in a 
> format-neutral manner w/o huge effort.
> * Replace {{name}} with {{id}} on anchors.
> * Table borders must be solved by CSS now
> * Affected elements: {{img}}, {{hr}}, links ({{a}}), {{table}}, 
> {{td}}/{{th}}, sections, verbatims, {{tr}}
> Virtual all deprecated attributes have been superseded by CSS. Improve also 
> tests because code is stricter now.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to