Skip to content

Commit e31eed1

Browse files
committed
🐛 fix footer links getting deleted
1 parent 73f11e2 commit e31eed1

File tree

4 files changed

+12
-2
lines changed

4 files changed

+12
-2
lines changed

‎scripts/bad-linebreaks-test.mjs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ const afterMD = './scripts/test-samples/bad-linebreaks-sample-after.md';
77
const beforeMD = './scripts/test-samples/bad-linebreaks-sample-before.md';
88

99
// verify hash values to detect file tampering
10-
const knownBeforeHash = '5dfa7a6c97c43bf3321f2e9ccafd3ce8';
11-
const knownAfterHash = '9ed9cc827a7ffa71e6c243a23d7e24a3';
10+
const knownBeforeHash = '95b97fa317298d9fd864b79ac93710d6';
11+
const knownAfterHash = '2a79139c3c3292cc5e807f531c714775';
1212
const beforeHash = await getHashSlingingSlasher(beforeMD);
1313
const afterHash = await getHashSlingingSlasher(afterMD);
1414
assert.strictEqual(beforeHash, knownBeforeHash);

‎scripts/bad-linebreaks.mjs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,12 @@ export function findBadStuff(file, fix = false) {
4949

5050
}
5151

52+
for (const k of Object.keys(tokens.links)) {
53+
// marked treats footer links as special. it's a named property on the tokens array, and links do not have the properties of tokens.
54+
// so we just add them as is
55+
o.push(`[${k}]: ${tokens.links[k].href}\n`);
56+
}
57+
5258
return {
5359
fixed: o.join(''),
5460
totalMatches,

‎scripts/test-samples/bad-linebreaks-sample-after.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,3 +92,5 @@ The officers were satisfied. My manner had convinced them. I was singularly at e
9292
No doubt I now grew very pale; but I talked more fluently and with a heightened voice. Yet the sound increased—and what could I do? It was a low, dull, quick sound—much such a sound as a watch makes when enveloped in cotton. I gasped for breath—and yet the officers heard it not. I talked more quickly—more vehemently; but the noise steadily increased. I arose and argued about trifles, in a high key and with violent gesticulations; but the noise steadily increased. Why would they not be gone? I paced the floor to and fro with heavy strides, as if excited to fury by the observations of the men—but the noise steadily increased. O God! what could I do? I foamed—I raved—I swore! I swung the chair upon which I had been sitting, and grated it upon the boards, but the noise arose over all and continually increased. It grew louder—louder—louder! And still the men chatted pleasantly, and smiled. Was it possible they heard not? Almighty God!—no, no! They heard!—they suspected!—they knew!—they were making a mockery of my horror!—this I thought, and this I think. But anything was better than this agony! Anything was more tolerable than this derision! I could bear those hypocritical smiles no longer! I felt that I must scream or die!—and now—again!—hark! louder! louder! louder! louder!
9393

9494
"Villains!" I shrieked, "dissemble no more! I admit the deed!—tear up the planks!—here, here!—it is the beating of his hideous heart!"
95+
96+
[linky-mclinkface]: https://tc39.es

‎scripts/test-samples/bad-linebreaks-sample-before.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,3 +136,5 @@ The officers were satisfied. My manner had convinced them. I was singularly at e
136136
No doubt I now grew very pale; but I talked more fluently and with a heightened voice. Yet the sound increased—and what could I do? It was a low, dull, quick sound—much such a sound as a watch makes when enveloped in cotton. I gasped for breath—and yet the officers heard it not. I talked more quickly—more vehemently; but the noise steadily increased. I arose and argued about trifles, in a high key and with violent gesticulations; but the noise steadily increased. Why would they not be gone? I paced the floor to and fro with heavy strides, as if excited to fury by the observations of the men—but the noise steadily increased. O God! what could I do? I foamed—I raved—I swore! I swung the chair upon which I had been sitting, and grated it upon the boards, but the noise arose over all and continually increased. It grew louder—louder—louder! And still the men chatted pleasantly, and smiled. Was it possible they heard not? Almighty God!—no, no! They heard!—they suspected!—they knew!—they were making a mockery of my horror!—this I thought, and this I think. But anything was better than this agony! Anything was more tolerable than this derision! I could bear those hypocritical smiles no longer! I felt that I must scream or die!—and now—again!—hark! louder! louder! louder! louder!
137137

138138
"Villains!" I shrieked, "dissemble no more! I admit the deed!—tear up the planks!—here, here!—it is the beating of his hideous heart!"
139+
140+
[Linky-McLinkFace]: https://tc39.es

0 commit comments

Comments
 (0)