+
Skip to content

Updated Markdown parser in Concordion 3.0.0 changes table text layout #316

Closed
@nigelcharman

Description

@nigelcharman

Report from a user:

Our test suite is using Markdown specifications. For logging purposes, our tests are using the special variable #TEXT to obtain the text of each row of a Concordion table. Prior to Concordion 3.0.0, individual cells in the row were delineated by \n. With the updated Markdown parser in Concordion 3.0.0 this is no longer the case and the cells are only delineated by whitespace. This affects our ability to parse the contents of the row. What workarounds can we use to restore this behaviour so our logging works correctly?

See attached test case for an example. This can be applied to the cubano-demo project. With the latest cubano-concordion:1.0.2 package, the test fails with IndexOutOfBoundsException. Change back to the Concordion 2.2.0 version using the build.gradle configuration below, and everything works fine.

TestMarkdownUpdates.java

package example.markdownparser;


import org.concordion.api.MultiValueResult;
import org.concordion.cubano.template.framework.CubanoDemoBrowserFixture;
import org.concordion.ext.storyboard.CardResult;
import org.concordion.ext.storyboard.StockCardImage;

public class TestMarkdownUpdates extends CubanoDemoBrowserFixture {

    public MultiValueResult parse(String data) throws Exception {
        System.out.println("-----------------");
        System.out.println(data);
        System.out.println("=-----------------=");

        System.out.println(data.split("\\n")[2].trim());
        System.out.println(data.split("\\n")[3].trim());
        System.out.println(data.split("\\n")[4].trim());

        MultiValueResult mvr = new MultiValueResult();
        mvr.put("id", 1);
        mvr.put("result", "Passed");

        getStoryboard().addSectionContainer(String.format("'%s' is '%s'", data.split("\\n")[2].trim(), data.split("\\n")[3].trim()));
        getStoryboard().addNotification("Hello", "Hello", StockCardImage.JSON, CardResult.SUCCESS);

        return mvr;
    }

}

TestMarkdownUpdates.md

# Heading

## [Test](-) 

Test ..... 

| [note][][An Id][]   |  Outcome     							  | Comment  | [Results][] |
| ------------------------------  | -------------- | ---------------------------------------- | -------- |
|                                 | Scenario1	 							  | True     | Passed      |
|                                 | Scenario2	 							  | False    | Passed      |
|                                 | Scenario3 								  | True     | Passed      |
|                                 | Scenario4                                | False    | Passed      |

[note]: - "#out = parse(#TEXT)"			
[An Id]: - "c:echo=#out.id"
[Results]: - "?=#out.result"

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载