diff --git a/bin/index.js b/bin/index.js index 09f2f48c..f08f597f 100755 --- a/bin/index.js +++ b/bin/index.js @@ -33,8 +33,8 @@ require('yargs') type: 'boolean', default: false }); - yargs.option('--withAP', { - describe: 'further transform for AP', + yargs.option('--withCicero', { + describe: 'further transform for Cicero', type: 'boolean', default: false }); @@ -45,7 +45,7 @@ require('yargs') try { argv = Commands.validateParseArgs(argv); - return Commands.parse(argv.sample, argv.out, argv.generateMarkdown, argv.withAP) + return Commands.parse(argv.sample, argv.out, argv.generateMarkdown, argv.withCicero) .then((result) => { if(result) {Logger.info('\n'+result);} }) diff --git a/src/Ciceromark.test.js b/src/CiceroMark.test.js similarity index 100% rename from src/Ciceromark.test.js rename to src/CiceroMark.test.js diff --git a/src/Commonmark.test.js b/src/CommonMark.test.js similarity index 100% rename from src/Commonmark.test.js rename to src/CommonMark.test.js diff --git a/src/ToCiceroVisitor.js b/src/ToCiceroVisitor.js index 2c20cbe3..64e7a1fb 100644 --- a/src/ToCiceroVisitor.js +++ b/src/ToCiceroVisitor.js @@ -66,8 +66,8 @@ class ToCiceroVisitor { thing.src = tag.attributes[0].value; thing.clauseid = tag.attributes[1].value; - const parsedNodes = parameters.commonMark.fromString(tag.content).nodes; - thing.nodes = parsedNodes ? ToCiceroVisitor.visitNodes(this, parsedNodes, parameters) : []; // Parse text as markdown (in the nodes for the root) + thing.nodes = parameters.commonMark.fromString(tag.content).nodes; + ToCiceroVisitor.visitNodes(this, thing.nodes, parameters); thing.text = null; // Remove text delete thing.tag; } @@ -77,8 +77,8 @@ class ToCiceroVisitor { thing.clauseid = tag.attributes[0].value; thing.src = tag.attributes[1].value; - const parsedNodes = parameters.commonMark.fromString(tag.content).nodes; - thing.nodes = parsedNodes ? ToCiceroVisitor.visitNodes(this, parsedNodes, parameters) : []; // Parse text as markdown (in the nodes for the root) + thing.nodes = parameters.commonMark.fromString(tag.content).nodes; + ToCiceroVisitor.visitNodes(this, thing.nodes, parameters); thing.text = null; // Remove text delete thing.tag; } else { diff --git a/src/__snapshots__/CiceroMark.test.js.snap b/src/__snapshots__/CiceroMark.test.js.snap index 9c24678b..848e2cb1 100644 --- a/src/__snapshots__/CiceroMark.test.js.snap +++ b/src/__snapshots__/CiceroMark.test.js.snap @@ -46,7 +46,7 @@ Object { }, Object { "$class": "org.accordproject.commonmark.CodeBlock", - "info": "", + "info": "", "tag": Object { "$class": "org.accordproject.commonmark.TagInfo", "attributeString": "id = \\"shipper\\" value = \\"%22Party%20A%22\\" ", diff --git a/src/__snapshots__/Commonmark.test.js.snap b/src/__snapshots__/CommonMark.test.js.snap similarity index 99% rename from src/__snapshots__/Commonmark.test.js.snap rename to src/__snapshots__/CommonMark.test.js.snap index 9c24678b..848e2cb1 100644 --- a/src/__snapshots__/Commonmark.test.js.snap +++ b/src/__snapshots__/CommonMark.test.js.snap @@ -46,7 +46,7 @@ Object { }, Object { "$class": "org.accordproject.commonmark.CodeBlock", - "info": "", + "info": "", "tag": Object { "$class": "org.accordproject.commonmark.TagInfo", "attributeString": "id = \\"shipper\\" value = \\"%22Party%20A%22\\" ", diff --git a/test/acceptance.md b/test/acceptance.md index 76ef4d14..b38edebb 100644 --- a/test/acceptance.md +++ b/test/acceptance.md @@ -2,7 +2,7 @@ And below is a **clause**. -``` +``` Acceptance of Delivery. will be deemed to have completed its delivery obligations if in 's opinion, the satisfies the Acceptance Criteria, and notifies in writing that it is accepting the . Inspection and Notice. will have Business Days' to inspect and evaluate the on the delivery date before notifying that it is either accepting or rejecting the .