[jira] [Commented] (DOXIA-497) APTSink: links and paragraphs inside tables

2018-07-16 Thread ASF GitHub Bot (JIRA)


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

ASF GitHub Bot commented on DOXIA-497:
--

asfgit closed pull request #13: [DOXIA-497] Fix rendering links and paragraphs 
inside tables
URL: https://github.com/apache/maven-doxia/pull/13
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git 
a/doxia-modules/doxia-module-apt/src/main/java/org/apache/maven/doxia/module/apt/AptSink.java
 
b/doxia-modules/doxia-module-apt/src/main/java/org/apache/maven/doxia/module/apt/AptSink.java
index 97467476..3747370f 100644
--- 
a/doxia-modules/doxia-module-apt/src/main/java/org/apache/maven/doxia/module/apt/AptSink.java
+++ 
b/doxia-modules/doxia-module-apt/src/main/java/org/apache/maven/doxia/module/apt/AptSink.java
@@ -65,6 +65,9 @@
 /**  tableCaptionFlag. */
 private boolean tableCaptionFlag;
 
+/**  tableCellFlag. */
+private boolean tableCellFlag;
+
 /**  headerFlag. */
 private boolean headerFlag;
 
@@ -164,6 +167,7 @@ protected void init()
 this.date = null;
 this.startFlag = true;
 this.tableCaptionFlag = false;
+this.tableCellFlag = false;
 this.headerFlag = false;
 this.bufferFlag = false;
 this.itemFlag = false;
@@ -518,7 +522,11 @@ public void pageBreak()
 /** {@inheritDoc} */
 public void paragraph()
 {
-if ( itemFlag )
+if ( tableCellFlag )
+{
+// ignore paragraphs in table cells
+}
+else if ( itemFlag )
 {
 write( EOL + EOL + "  " + listNestingIndent );
 }
@@ -531,7 +539,14 @@ public void paragraph()
 /** {@inheritDoc} */
 public void paragraph_()
 {
-write( EOL + EOL );
+   if ( tableCellFlag )
+   {
+   // ignore paragraphs in table cells
+   }
+   else
+   {
+   write( EOL + EOL );
+   }
 }
 
 /** {@inheritDoc} */
@@ -696,6 +711,7 @@ public void tableCell( boolean headerRow )
 {
 buffer.append( TABLE_CELL_SEPARATOR_MARKUP );
 }
+tableCellFlag = true;
 }
 
 /** {@inheritDoc} */
@@ -715,6 +731,7 @@ public void tableHeaderCell_()
  */
 private void endTableCell()
 {
+tableCellFlag = false;
 buffer.append( TABLE_CELL_SEPARATOR_MARKUP );
 cellCount++;
 }
@@ -928,7 +945,14 @@ public void unknown( String name, Object[] requiredParams, 
SinkEventAttributes a
 protected void write( String text )
 {
 startFlag = false;
-writer.write( unifyEOLs( text ) );
+if ( tableCellFlag )
+{
+   buffer.append( text );
+   }
+else
+{
+   writer.write( unifyEOLs( text ) );
+   }
 }
 
 /**
diff --git 
a/doxia-modules/doxia-module-apt/src/test/java/org/apache/maven/doxia/module/apt/AptSinkTest.java
 
b/doxia-modules/doxia-module-apt/src/test/java/org/apache/maven/doxia/module/apt/AptSinkTest.java
index af310e9a..812f4965 100644
--- 
a/doxia-modules/doxia-module-apt/src/test/java/org/apache/maven/doxia/module/apt/AptSinkTest.java
+++ 
b/doxia-modules/doxia-module-apt/src/test/java/org/apache/maven/doxia/module/apt/AptSinkTest.java
@@ -275,4 +275,58 @@ protected String getCommentBlock( String text )
 {
 return "~~" + text;
 }
+
+/**
+ * test for DOXIA-497.
+ */
+public void testLinksAndParagraphsInTableCells()
+{
+final String linkTarget = "target";
+final String linkText = "link";
+final String paragraphText = "paragraph text";
+final Sink sink = getSink();
+sink.table();
+sink.tableRow();
+sink.tableCell();
+sink.link(linkTarget);
+sink.text(linkText);
+sink.link_();
+sink.tableCell_();
+sink.tableCell();
+sink.paragraph();
+sink.text(paragraphText);
+sink.paragraph_();
+sink.tableCell_();
+sink.tableRow_();
+sink.table_();
+sink.flush();
+sink.close();
+
+String expected = EOL + AptMarkup.TABLE_ROW_START_MARKUP +
+AptMarkup.MINUS +
+AptMarkup.MINUS +
+AptMarkup.TABLE_ROW_START_MARKUP +
+AptMarkup.STAR +
+EOL +
+AptMarkup.LEFT_CURLY_BRACKET +
+AptMarkup.LEFT_CURLY_BRACKET +
+AptMarkup.LEFT_CURLY_BRACKET +
+linkTarget +
+AptMarkup.RIGHT_CURLY_BRACKET +
+linkText +
+AptMarkup.RIGHT_CURLY_BRACKET +
+AptMarkup.RIGHT_CURLY_BRACKET +
+ 

[jira] [Commented] (DOXIA-497) APTSink: links and paragraphs inside tables

2018-07-15 Thread ASF GitHub Bot (JIRA)


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

ASF GitHub Bot commented on DOXIA-497:
--

slachiewicz opened a new pull request #13: [DOXIA-497] Fix rendering links and 
paragraphs inside tables
URL: https://github.com/apache/maven-doxia/pull/13
 
 
   


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> APTSink: links and paragraphs inside tables
> ---
>
> Key: DOXIA-497
> URL: https://issues.apache.org/jira/browse/DOXIA-497
> Project: Maven Doxia
>  Issue Type: Bug
>  Components: Module - Apt
>Affects Versions: 1.4, 1.5
>Reporter: Martin Kurz
>Priority: Major
> Attachments: table-generation.patch
>
>
> When generating table markup with APTSink, link content is written to buffer 
> while structure markup is directly written, so the generated markup is 
> invalid. When writing paragraphs inside table cells, the generated markup is 
> also invalid.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (DOXIA-497) APTSink: links and paragraphs inside tables

2017-03-25 Thread JIRA

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

Hervé Boutemy commented on DOXIA-497:
-

what makes you wait for 2.0?
this does look like a simple bugfix, isn't it? or did I miss something 
important?

> APTSink: links and paragraphs inside tables
> ---
>
> Key: DOXIA-497
> URL: https://issues.apache.org/jira/browse/DOXIA-497
> Project: Maven Doxia
>  Issue Type: Bug
>  Components: Module - Apt
>Affects Versions: 1.4, 1.5
>Reporter: Martin Kurz
> Attachments: table-generation.patch
>
>
> When generating table markup with APTSink, link content is written to buffer 
> while structure markup is directly written, so the generated markup is 
> invalid. When writing paragraphs inside table cells, the generated markup is 
> also invalid.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)


[jira] [Commented] (DOXIA-497) APTSink: links and paragraphs inside tables

2017-01-07 Thread Michael Osipov (JIRA)

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

Michael Osipov commented on DOXIA-497:
--

I think this should be addressed in 2.0 which Maven upgrade to 3.x.

> APTSink: links and paragraphs inside tables
> ---
>
> Key: DOXIA-497
> URL: https://issues.apache.org/jira/browse/DOXIA-497
> Project: Maven Doxia
>  Issue Type: Bug
>  Components: Module - Apt
>Affects Versions: 1.4, 1.5
>Reporter: Martin Kurz
> Attachments: table-generation.patch
>
>
> When generating table markup with APTSink, link content is written to buffer 
> while structure markup is directly written, so the generated markup is 
> invalid. When writing paragraphs inside table cells, the generated markup is 
> also invalid.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)