Skip to content

Commit daac10e

Browse files
authored
fix: prefer closing double quote (#246)
1 parent 696004c commit daac10e

File tree

4 files changed

+7
-3
lines changed

4 files changed

+7
-3
lines changed

workspace/aubade/src/artisan/example.spec.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -794,6 +794,10 @@ describe('libretto', ({ concurrent: it }) => {
794794
'quotes#mixed/5': [`"'hello'"`, '<p>“‘hello’”</p>'],
795795
'quotes#mixed/6': [`"i'm sure"`, '<p>“i’m sure”</p>'],
796796
'quotes#mixed/7': [`"13" laptop"`, '<p>“13″ laptop”</p>'],
797+
'quotes#mixed/8': [
798+
`"first!", "second?", and "third?".`,
799+
'<p>“first!”, “second?”, and “third?”.</p>',
800+
],
797801

798802
'strike#single': ['~strike~', '<p>~strike~</p>'],
799803
'strike#normal': ['~~strike~~', '<p><del>strike</del></p>'],

workspace/aubade/src/artisan/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ export function typography(text: string): string {
101101
const left = util.is['left-flanking'](prev || ' ', next || ' ');
102102
const right = util.is['right-flanking'](prev || ' ', next || ' ');
103103

104-
const double = left ? '“' : right ? (prime ? '″' : '”') : char;
104+
const double = right ? (prime ? '″' : '”') : left ? '“' : char;
105105
const single = right ? (prime ? '′' : '’') : left ? '‘' : char;
106106
output += char === '"' ? double : single;
107107
}

workspace/aubade/src/palette/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,5 +68,5 @@ export const codeblock: Resolver<'block:code'> = ({ token, sanitize }) => {
6868
'</header>',
6969
`<pre data-aubade="pre">${highlight(token.meta.code, dataset)}</pre>`,
7070
'</div>',
71-
].join('');
71+
].join('\n');
7272
};

workspace/website/src/routes/content/builder.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ export const DATA = {
1313
const { doc, manifest, meta } = assemble(buffer.toString('utf-8'));
1414

1515
function materialize(source: string): string {
16-
const asset = siblings.find(({ filename }) => source === filename);
16+
const asset = siblings.find(({ filename }) => source.endsWith(filename));
1717
if (!asset || !/\.(jpe?g|png|svg|mp4)$/.test(asset.filename)) return source;
1818
task(async ({ fs }) => {
1919
await fs.mkdir(ROOT, { recursive: true });

0 commit comments

Comments
 (0)