Skip to content

Commit 0400c50

Browse files
committed
fix(tests) Remove spurious $ in HTML transform, clean up HTML tests
Signed-off-by: Jerome Simeon <[email protected]>
1 parent 80d82be commit 0400c50

File tree

3 files changed

+20
-39
lines changed

3 files changed

+20
-39
lines changed

packages/markdown-cli/test/cli.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,6 @@ describe('markdown-cli', () => {
8181
options.slate = false;
8282
options.noWrap = true;
8383
const result = await Commands.parse(sample, null, options);
84-
console.log(result);
8584
result.should.eql(sampleExpectedText);
8685
});
8786

packages/markdown-html/src/ToHtmlStringVisitor.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ class ToHtmlStringVisitor {
9393
// const ciceroMarkTransformer = new CiceroMarkTransformer();
9494
// console.log(JSON.stringify(ciceroMarkTransformer.getSerializer().toJSON(thing), null, 4));
9595
// }
96-
parameters.result += `<div class="clause" clauseid="${thing.clauseid}" src="${thing.src}">\n$${ToHtmlStringVisitor.visitChildren(this, thing)}</div>\n`;
96+
parameters.result += `<div class="clause" clauseid="${thing.clauseid}" src="${thing.src}">\n${ToHtmlStringVisitor.visitChildren(this, thing)}</div>\n`;
9797
break;
9898
case 'Variable':
9999
parameters.result += `<div class="variable" id="${thing.id}">${thing.value}</div>\n`;

packages/markdown-html/src/__snapshots__/HtmlTransformer.test.js.snap

Lines changed: 19 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -248,36 +248,22 @@ exports[`html converts acceptance.md to html 2`] = `
248248
<h1>HELLO! This is the contract editor.</h1>
249249
<p>And below is a <strong>clause</strong>.</p>
250250
<div class=\\"clause\\" clauseid=\\"479adbb4-dc55-4d1a-ab12-b6c5e16900c0\\" src=\\"ap://[email protected]#721d1aa0999a5d278653e211ae2a64b75fdd8ca6fa1f34255533c942404c5c1f\\">
251-
$<p>Acceptance of Delivery. <div class=\\"variable\\" id=\\"shipper\\">
252-
$\\"Party A\\"</div>
253-
will be deemed to have completed its delivery obligations if in <div class=\\"variable\\" id=\\"receiver\\">
254-
$\\"Party B\\"</div>
255-
's opinion, the <div class=\\"variable\\" id=\\"deliverable\\">
256-
$\\"Widgets\\"</div>
257-
satisfies the Acceptance Criteria, and <div class=\\"variable\\" id=\\"receiver\\">
258-
$\\"Party B\\"</div>
259-
notifies <div class=\\"variable\\" id=\\"shipper\\">
260-
$\\"Party A\\"</div>
261-
in writing that it is accepting the <div class=\\"variable\\" id=\\"deliverable\\">
262-
$\\"Widgets\\"</div>
251+
<p>Acceptance of Delivery. <div class=\\"variable\\" id=\\"shipper\\">\\"Party A\\"</div>
252+
will be deemed to have completed its delivery obligations if in <div class=\\"variable\\" id=\\"receiver\\">\\"Party B\\"</div>
253+
's opinion, the <div class=\\"variable\\" id=\\"deliverable\\">\\"Widgets\\"</div>
254+
satisfies the Acceptance Criteria, and <div class=\\"variable\\" id=\\"receiver\\">\\"Party B\\"</div>
255+
notifies <div class=\\"variable\\" id=\\"shipper\\">\\"Party A\\"</div>
256+
in writing that it is accepting the <div class=\\"variable\\" id=\\"deliverable\\">\\"Widgets\\"</div>
263257
.</p>
264-
<p>Inspection and Notice. <div class=\\"variable\\" id=\\"receiver\\">
265-
$\\"Party B\\"</div>
266-
will have <div class=\\"variable\\" id=\\"businessDays\\">
267-
$10</div>
268-
Business Days' to inspect and evaluate the <div class=\\"variable\\" id=\\"deliverable\\">
269-
$\\"Widgets\\"</div>
270-
on the delivery date before notifying <div class=\\"variable\\" id=\\"shipper\\">
271-
$\\"Party A\\"</div>
272-
that it is either accepting or rejecting the <div class=\\"variable\\" id=\\"deliverable\\">
273-
$\\"Widgets\\"</div>
258+
<p>Inspection and Notice. <div class=\\"variable\\" id=\\"receiver\\">\\"Party B\\"</div>
259+
will have <div class=\\"variable\\" id=\\"businessDays\\">10</div>
260+
Business Days' to inspect and evaluate the <div class=\\"variable\\" id=\\"deliverable\\">\\"Widgets\\"</div>
261+
on the delivery date before notifying <div class=\\"variable\\" id=\\"shipper\\">\\"Party A\\"</div>
262+
that it is either accepting or rejecting the <div class=\\"variable\\" id=\\"deliverable\\">\\"Widgets\\"</div>
274263
.</p>
275-
<p>Acceptance Criteria. The \\"Acceptance Criteria\\" are the specifications the <div class=\\"variable\\" id=\\"deliverable\\">
276-
$\\"Widgets\\"</div>
277-
must meet for the <div class=\\"variable\\" id=\\"shipper\\">
278-
$\\"Party A\\"</div>
279-
to comply with its requirements and obligations under this agreement, detailed in <div class=\\"variable\\" id=\\"attachment\\">
280-
$\\"Attachment X\\"</div>
264+
<p>Acceptance Criteria. The \\"Acceptance Criteria\\" are the specifications the <div class=\\"variable\\" id=\\"deliverable\\">\\"Widgets\\"</div>
265+
must meet for the <div class=\\"variable\\" id=\\"shipper\\">\\"Party A\\"</div>
266+
to comply with its requirements and obligations under this agreement, detailed in <div class=\\"variable\\" id=\\"attachment\\">\\"Attachment X\\"</div>
281267
, attached to this agreement.</p>
282268
</div>
283269
</body>
@@ -466,14 +452,11 @@ content",
466452
exports[`html converts clause.md to html 2`] = `
467453
"<html>
468454
<body>
469-
<p>This is a fixed interest loan to the amount of <div class=\\"variable\\" id=\\"loanAmount\\">
470-
$100000.0</div>
455+
<p>This is a fixed interest loan to the amount of <div class=\\"variable\\" id=\\"loanAmount\\">100000.0</div>
471456
472-
at the yearly interest rate of <div class=\\"variable\\" id=\\"rate\\">
473-
$2.5</div>
457+
at the yearly interest rate of <div class=\\"variable\\" id=\\"rate\\">2.5</div>
474458
%
475-
with a loan term of <div class=\\"variable\\" id=\\"loanDuration\\">
476-
$15</div>
459+
with a loan term of <div class=\\"variable\\" id=\\"loanDuration\\">15</div>
477460
,
478461
and monthly payments of <div class=\\"computed>667.0</div>
479462
</p>
@@ -482,9 +465,8 @@ at the yearly interest rate of 2.5%
482465
with a loan term of 15,
483466
and monthly payments of 667.0</p>
484467
<div class=\\"clause\\" clauseid=\\"bar\\" src=\\"foo\\">
485-
$<p>this is
486-
multiline <div class=\\"variable\\" id=\\"rate\\">
487-
$2.5</div>
468+
<p>this is
469+
multiline <div class=\\"variable\\" id=\\"rate\\">2.5</div>
488470
</p>
489471
<p>content</p>
490472
</div>

0 commit comments

Comments
 (0)