Skip to content

Commit

Permalink
Merge branch 'release/7.9'
Browse files Browse the repository at this point in the history
  • Loading branch information
Build Pipeline committed Jan 4, 2023
2 parents 10013a4 + e08c928 commit b806b3b
Show file tree
Hide file tree
Showing 17 changed files with 230 additions and 154 deletions.
218 changes: 134 additions & 84 deletions CHANGELOG.md

Large diffs are not rendered by default.

35 changes: 18 additions & 17 deletions README.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion addon-scrollversions/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>maven-confluence-parent</artifactId>
<groupId>org.bsc.maven</groupId>
<version>7.8</version>
<version>7.9</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
2 changes: 1 addition & 1 deletion core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>maven-confluence-parent</artifactId>
<groupId>org.bsc.maven</groupId>
<version>7.8</version>
<version>7.9</version>
</parent>

<modelVersion>4.0.0</modelVersion>
Expand Down
2 changes: 1 addition & 1 deletion gitlog+jira/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>maven-confluence-parent</artifactId>
<groupId>org.bsc.maven</groupId>
<version>7.8</version>
<version>7.9</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
2 changes: 1 addition & 1 deletion plugin-reporting/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>maven-confluence-parent</artifactId>
<groupId>org.bsc.maven</groupId>
<version>7.8</version>
<version>7.9</version>
</parent>

<prerequisites>
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<groupId>org.bsc.maven</groupId>
<artifactId>maven-confluence-parent</artifactId>
<packaging>pom</packaging>
<version>7.8</version>
<version>7.9</version>
<name>CONFLUENCE-REPORTING::Parent</name>
<description>Maven's plugin that allow to generate "project's documentation" directly to confluence allowing, in the
same time, to keep in-sync both project &amp; documentation
Expand Down
4 changes: 2 additions & 2 deletions processor-commonmark/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@
<parent>
<artifactId>maven-confluence-parent</artifactId>
<groupId>org.bsc.maven</groupId>
<version>7.8</version>
<version>7.9</version>
</parent>
<modelVersion>4.0.0</modelVersion>

<artifactId>confluence-markdown-processor-commonmark</artifactId>
<name>CONFLUENCE-REPORTING::Markdown::Commonmark::Processor</name>

<properties>
<commonmark.version>0.18.2</commonmark.version>
<commonmark.version>0.21.0</commonmark.version>
</properties>

<dependencies>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,10 +119,10 @@ public void visit(Paragraph node) {
final ChildrenProcessor p = processChildren(node);

if( isParentRoot(node) ) {
p.post("\n");
p.post(() -> "\n");
}
else if( node.getParent() instanceof ListBlock ) {
p.pre("\n");
p.pre(() -> "\n");
}

p.process().nl();
Expand All @@ -136,7 +136,7 @@ else if( node.getParent() instanceof ListBlock ) {
*/
@Override
public void visit(HardLineBreak node) {
processChildren(node).pre("\\\\").process().nl();
processChildren(node).pre(() -> "\\\\").process().nl();
}

/**
Expand All @@ -156,14 +156,14 @@ public void visit(SoftLineBreak node) {
public void visit(Text node) {
final String literal = escapeMarkdownText( node, node.getLiteral() );
processChildren(node)
.pre( literal )
.pre( () -> literal )
.process();
}

@Override
public void visit(Heading node) {
processChildren(node)
.pre( format( "h%s. ", node.getLevel()) )
.pre( () -> format( "h%s. ", node.getLevel()) )
.process().nl();
}

Expand Down Expand Up @@ -209,8 +209,8 @@ public void visit(BulletList node) {
public void visit(BlockQuote node) {

processChildren(node)
.pre("{quote}\n")
.post("{quote}\n")
.pre(() -> "{quote}\n")
.post(() ->"{quote}\n")
.process()
.nl( isParentRoot(node) );
}
Expand All @@ -220,7 +220,7 @@ public void visit(Code node) {
final String literal = escapeMarkdownText( node, node.getLiteral());

processChildren(node)
.pre( "{{%s}}", literal )
.pre(() -> format("{{%s}}", literal) )
.process();
}

Expand All @@ -229,20 +229,20 @@ public void visit(FencedCodeBlock node) {
final Function<String,String> info = (v) -> (v==null || v.length()==0 ) ? "" : ":"+v ;

processChildren(node)
.pre( "{code%s}\n%s", info.apply(node.getInfo()), node.getLiteral() )
.post("{code}")
.pre( () -> format("{code%s}\n%s", info.apply(node.getInfo()), node.getLiteral()) )
.post(() ->"{code}")
.process().nl();
}

@Override
public void visit(Emphasis node) {
processChildren(node).pre("_").post("_").process();
processChildren(node).pre(() -> "_").post(() -> "_").process();

}

@Override
public void visit(StrongEmphasis node) {
processChildren(node).pre("*").post("*").process();;
processChildren(node).pre(() -> "*").post(() -> "*").process();;
}

@Override
Expand All @@ -252,8 +252,8 @@ public void visit(Image node) {

processChildren(node)
//.pre( format("<<IMG destination=[%s] title=[%s]>>", node.getDestination(), node.getTitle())).post("<</IMG>>")
.pre( "!%s|", destination, node.getTitle() )
.post("!")
.pre(() -> format("!%s|", destination, node.getTitle()) )
.post(() -> "!")
.process()
.nl( isParentRoot(node) );
}
Expand All @@ -272,16 +272,16 @@ public void visit(Link node) {

processChildren(node)
//.preAndPost("<<LNK>>")
.pre( "[" )
.pre(() -> "[" )
.captureOutput( v -> buffer().append(v) ) // ignore text
.post("|%s%s]", destination, ofNullable(node.getTitle()).map( v -> "|"+v ).orElse(""))
.post(() -> format("|%s%s]", destination, ofNullable(node.getTitle()).map( v -> "|"+v ).orElse("")) )
.process()
.nl(isParentRoot(node));
}

@Override
public void visit(ThematicBreak node) {
processChildren(node).pre("----").process().nl();
processChildren(node).pre(() -> "----").process().nl();
}

//@Custom
Expand All @@ -303,7 +303,7 @@ public void visit( TableBody node ) {
//@Custom
public void visit( TableRow node ) {
processChildren(node)
.pre("|")
.pre(() -> "|")
.post( () -> ( node.getParent() instanceof TableHead ) ? "|" : "" )
.process()
.nl();
Expand All @@ -317,7 +317,7 @@ public void visit( TableCell node ) {
buffer().append( value.isEmpty() ? ' ' : value );
})
.pre( () -> ( node.isHeader()) ? "|" : "" )
.post( "|" )
.post( () -> "|" )
.process();
}

Expand All @@ -328,14 +328,14 @@ public void visit(HtmlBlock node) {
final Matcher m = parseHTMLComment(literal);
if( m.matches() && isConfluenceMacro( m.group(2) ) ) {
processChildren(node)
.pre(m.group(1))
.post(m.group(2))
.pre(() -> m.group(1))
.post(() -> m.group(2))
.process().nl();
}
else {
processChildren(node)
.pre("{html}\n%s\n", literal)
.post("{html}")
.pre(() -> format("{html}\n%s\n", literal) )
.post(() -> "{html}")
.process().nl();
}
}
Expand All @@ -349,7 +349,7 @@ public void visit(HtmlInline node) {

//@Custom
public void visit( Strikethrough node ) {
processChildren(node).pre("-").post("-").process();
processChildren(node).pre(() -> "-").post(() -> "-").process();
}

//@custom
Expand All @@ -358,13 +358,13 @@ public void visit(NoticeBlock node) {
final ChildrenProcessor p = processChildren(node);

if( node.getTitle().isPresent() ) {
p.pre( "{%s:title=%s}\n", type, node.getTitle().get());
p.pre(() -> format("{%s:title=%s}\n", type, node.getTitle().get()) );
}
else {
p.pre("{%s}\n", type);
p.pre(() -> format("{%s}\n", type));
}

p.post("{%s}\n", type)
p.post(() -> format("{%s}\n", type))
.process()
.nl(isParentRoot(node));
}
Expand Down Expand Up @@ -393,7 +393,11 @@ else if( node instanceof TableBody ) {
return;
}

processChildren(node).pre("<<CSTN type=\"%s\">>", node.getClass().getSimpleName()).post("<</CSTN>>").process().nl();
processChildren(node)
.pre(() -> format("<<CSTN type=\"%s\">>", node.getClass().getSimpleName()))
.post(() -> "<</CSTN>>")
.process()
.nl();
}

@Override
Expand All @@ -407,12 +411,16 @@ else if( node instanceof NoticeBlock) {
visit( (NoticeBlock)node );
return;
}
processChildren(node).pre("<<CSTB type=\"%s\">>", node.getClass().getSimpleName()).post("<</CSTB>>").process().nl();
processChildren(node)
.pre(() -> format("<<CSTB type=\"%s\">>", node.getClass().getSimpleName()))
.post(() -> "<</CSTB>>")
.process()
.nl();
}

@Override
public void visit(IndentedCodeBlock node) {
processChildren(node).pre("<<ICB>>").post("<</ICB>>").process().nl();
processChildren(node).pre(() -> "<<ICB>>").post(() -> "<</ICB>>").process().nl();
}

@Override
Expand Down Expand Up @@ -445,21 +453,11 @@ ChildrenProcessor<T> captureOutput(Consumer<String> v) {
return this;
}

ChildrenProcessor<T> pre(String v, Object ...args) {
pre = of( () -> format( v, args));
return this;
}

ChildrenProcessor<T> pre( Supplier<String> supplier) {
pre = ofNullable( supplier );
return this;
}

ChildrenProcessor<T> post(String v, Object ...args) {
post = of( () -> format( v, args));
return this;
}

ChildrenProcessor<T> post(Supplier<String> supplier) {
post = ofNullable( supplier );
return this;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
package org.bsc.makdown.commonmark

import org.bsc.confluence.model.Site
import org.junit.jupiter.api.Assertions.assertEquals
import org.junit.jupiter.api.Test
import java.nio.file.Paths

class Issue282Test {

var site = Site().apply {
basedir = Paths.get(System.getProperty("user.dir"))
}

@Test
fun parse() {
val content = parseResource( this.javaClass, "issue282", this.site )

assertEquals("""
test coverage of at least 70%. (Measures to show this for each PR will need to be investigated)
""".trimIndent(), content )
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ import org.apache.commons.io.IOUtils
import org.bsc.confluence.model.Site
import org.bsc.markdown.MarkdownParserContext
import org.bsc.markdown.commonmark.CommonmarkConfluenceWikiVisitor
import org.junit.jupiter.api.Assertions.fail
import org.junit.jupiter.api.fail
import java.nio.charset.Charset
import java.util.*

Expand Down Expand Up @@ -34,7 +36,7 @@ fun parseResource(type: Class<*>, name: String, site: Site): String? =
parseContent(site, IOUtils.toString(it, Charset.defaultCharset()))
}
} catch (e: Exception) {
//Assertions.fail()
fail( e )
null;
}

2 changes: 2 additions & 0 deletions processor-commonmark/src/test/resources/issue282.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@

test coverage of at least 70%. (Measures to show this for each PR will need to be investigated)
2 changes: 1 addition & 1 deletion processor-freemarker/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>org.bsc.maven</groupId>
<artifactId>maven-confluence-parent</artifactId>
<version>7.8</version>
<version>7.9</version>
</parent>
<artifactId>maven-confluence-processor-freemarker</artifactId>
<name>CONFLUENCE-REPORTING::Freemaker::Processor</name>
Expand Down
2 changes: 1 addition & 1 deletion service-rest-api/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>maven-confluence-parent</artifactId>
<groupId>org.bsc.maven</groupId>
<version>7.8</version>
<version>7.9</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
2 changes: 1 addition & 1 deletion service-xmlrpc-api/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>maven-confluence-parent</artifactId>
<groupId>org.bsc.maven</groupId>
<version>7.8</version>
<version>7.9</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
2 changes: 1 addition & 1 deletion test-plugin/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<artifactId>maven-confluence-parent</artifactId>
<groupId>org.bsc.maven</groupId>
<version>7.8</version>
<version>7.9</version>
</parent>

<!-- TEST ISSUE 263 -->
Expand Down
2 changes: 1 addition & 1 deletion test-publishing/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<parent>
<artifactId>maven-confluence-parent</artifactId>
<groupId>org.bsc.maven</groupId>
<version>7.8</version>
<version>7.9</version>
</parent>

<modelVersion>4.0.0</modelVersion>
Expand Down

0 comments on commit b806b3b

Please sign in to comment.