Skip to content

Commit c1d0472

Browse files
committed
Fix spacing in output
1 parent cf1fb67 commit c1d0472

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

src/compile.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ export function compile(dir: string = '.', config: Config = {}): void {
7777
}
7878

7979
// Create plaintext of HTML for use as description/metadata property.
80-
const plaintextData = parsedContent.replace(/<.+?>/gs, ' ');
80+
const plaintextData = parsedContent.replace(/<.+?>/gs, '');
8181

8282
// Create HTML
8383
const folderUpCount = file.split(/[\/\\]/).length - dir.split(/[\/\\]/).length; // number of folders to go up by to get to root

src/parse.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -345,7 +345,7 @@ export function parse(data: string, config: Config = {}): Result {
345345
.replace(re(r`^ (:+) (.+?) $`), (_, lvl, content) => {
346346
if (content.includes('{{')) return _;
347347
const depth = lvl.length;
348-
return `${'<dl>'.repeat(depth)}<dd>${content}</dd>${'</dl>'.repeat(depth)}`
348+
return `${'<dl>'.repeat(depth)}<dd>${content}</dd>${'</dl>'.repeat(depth)}`;
349349
})
350350
.replace(re(r`^ ; (.+) $`), '<dl><dt>$1</dt></dl>')
351351
.replace(re(r`</dl> (\s*?) <dl>`), '$1')
@@ -375,7 +375,7 @@ export function parse(data: string, config: Config = {}): Result {
375375

376376
const refData = { ref: text, id: refs.length + 1, name: refname, i: 0 };
377377
refs.push(refData);
378-
return `<sup class="refnote"><a id="cite-${refData.id}" class="ref" href="#ref-${refData.id}">[${refData.id}]</a></sup>`
378+
return `<sup class="refnote"><a id="cite-${refData.id}" class="ref" href="#ref-${refData.id}">[${refData.id}]</a></sup>`;
379379
})
380380
.replace(re(r`< ref \s* name \s* = \s* ["']? ( [^>"']+ ) ["']? \s* (?: /> | > .*? </ref> )`), (_, refname) => {
381381
const ref = refs.find(ref => ref.name === refname);
@@ -387,7 +387,7 @@ export function parse(data: string, config: Config = {}): Result {
387387
[${ref.id}]
388388
</a>
389389
</sup>
390-
`;
390+
`.trim();
391391
return content;
392392
})
393393

@@ -414,7 +414,7 @@ export function parse(data: string, config: Config = {}): Result {
414414
let multiRefContent = '';
415415
if (refdata.i > 0) {
416416
for (let i = 0; i <= refdata.i; i++) {
417-
multiRefContent += `<sup><a href="#cite-${refdata.id}${i > 0 ? `_${i}` : ''}">${i + 1}</a></sup>`;
417+
multiRefContent += `<sup><a href="#cite-${refdata.id}${i > 0 ? `_${i}` : ''}">${i + 1}</a></sup>&nbsp;`;
418418
}
419419
}
420420
const refline = `

src/wiki.css.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ ul, ol {margin: 0.3em 0 0 1.6em; padding: 0;}
66
dt {font-weight: bold;}
77
dd, dl dl {margin-block: 0; margin-inline-start: 30px;}
88
9-
figure {margin: 1em;}
9+
figure {margin: 1em; width: 300px;}
1010
.image-thumb, .image-frame {padding: 6px; border: 1px solid gray;}
1111
.image-default {margin: 0;}
1212
figcaption {padding-top: 6px;}

0 commit comments

Comments
 (0)