Skip to content

Commit e4fe302

Browse files
committed
fix(validate) Validate even when targeting JSON
Signed-off-by: Jerome Simeon <[email protected]>
1 parent 3971a04 commit e4fe302

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

packages/markdown-cli/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"access": "public"
1111
},
1212
"bin": {
13-
"mdtransform": "./index.js"
13+
"markus": "./index.js"
1414
},
1515
"files": [
1616
"bin",

packages/markdown-cli/test/data/acceptance.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@
3737
{
3838
"$class":"org.accordproject.commonmark.CodeBlock",
3939
"info":"<clause src=\"ap://[email protected]#721d1aa0999a5d278653e211ae2a64b75fdd8ca6fa1f34255533c942404c5c1f\" clauseid=\"479adbb4-dc55-4d1a-ab12-b6c5e16900c0\"/>",
40-
"text":"Acceptance of Delivery. <variable id=\"shipper\" value=\"%22Party%20A%22\"/> will be deemed to have completed its delivery obligations if in <variable id=\"receiver\" value=\"%22Party%20B%22\"/>'s opinion, the <variable id=\"deliverable\" value=\"%22Widgets%22\"/> satisfies the Acceptance Criteria, and <variable id=\"receiver\" value=\"%22Party%20B%22\"/> notifies <variable id=\"shipper\" value=\"%22Party%20A%22\"/> in writing that it is accepting the <variable id=\"deliverable\" value=\"%22Widgets%22\"/>.\n\nInspection and Notice. <variable id=\"receiver\" value=\"%22Party%20B%22\"/> will have <variable id=\"businessDays\" value=\"10\"/> Business Days' to inspect and evaluate the <variable id=\"deliverable\" value=\"%22Widgets%22\"/> on the delivery date before notifying <variable id=\"shipper\" value=\"%22Party%20A%22\"/> that it is either accepting or rejecting the <variable id=\"deliverable\" value=\"%22Widgets%22\"/>.\n\nAcceptance Criteria. The \"Acceptance Criteria\" are the specifications the <variable id=\"deliverable\" value=\"%22Widgets%22\"/> must meet for the <variable id=\"shipper\" value=\"%22Party%20A%22\"/> to comply with its requirements and obligations under this agreement, detailed in <variable id=\"attachment\" value=\"%22Attachment%20X%22\"/>, attached to this agreement.\n",
4140
"tag":{
4241
"$class":"org.accordproject.commonmark.TagInfo",
4342
"tagName":"clause",
@@ -56,7 +55,8 @@
5655
],
5756
"content":"",
5857
"closed":true
59-
}
58+
},
59+
"text":"Acceptance of Delivery. <variable id=\"shipper\" value=\"%22Party%20A%22\"/> will be deemed to have completed its delivery obligations if in <variable id=\"receiver\" value=\"%22Party%20B%22\"/>'s opinion, the <variable id=\"deliverable\" value=\"%22Widgets%22\"/> satisfies the Acceptance Criteria, and <variable id=\"receiver\" value=\"%22Party%20B%22\"/> notifies <variable id=\"shipper\" value=\"%22Party%20A%22\"/> in writing that it is accepting the <variable id=\"deliverable\" value=\"%22Widgets%22\"/>.\n\nInspection and Notice. <variable id=\"receiver\" value=\"%22Party%20B%22\"/> will have <variable id=\"businessDays\" value=\"10\"/> Business Days' to inspect and evaluate the <variable id=\"deliverable\" value=\"%22Widgets%22\"/> on the delivery date before notifying <variable id=\"shipper\" value=\"%22Party%20A%22\"/> that it is either accepting or rejecting the <variable id=\"deliverable\" value=\"%22Widgets%22\"/>.\n\nAcceptance Criteria. The \"Acceptance Criteria\" are the specifications the <variable id=\"deliverable\" value=\"%22Widgets%22\"/> must meet for the <variable id=\"shipper\" value=\"%22Party%20A%22\"/> to comply with its requirements and obligations under this agreement, detailed in <variable id=\"attachment\" value=\"%22Attachment%20X%22\"/>, attached to this agreement.\n"
6060
}
6161
]
6262
}

packages/markdown-common/src/CommonMarkTransformer.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,8 @@ class CommonMarkTransformer {
200200
return this.serializer.fromJSON(json);
201201
}
202202
else {
203-
return json;
203+
const validJson = this.serializer.fromJSON(json);
204+
return this.serializer.toJSON(validJson);
204205
}
205206
}
206207

0 commit comments

Comments
 (0)