Skip to content

Commit 7e45c54

Browse files
committed
tidy format-rawhtml.ts
it wasn't being tidied previously due to it's previous directory not being included by the precious prettier-scripts command
1 parent e978228 commit 7e45c54

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

bin/format-rawhtml.ts

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import * as fs from 'fs';
2-
import * as path from 'path';
32
import * as prettier from 'prettier';
43

54
// HTML tags to match inside .md files
@@ -33,7 +32,10 @@ const formatHtmlBlocks = async (content: string, filePath: string) => {
3332
const regex = new RegExp(htmlBlockRegex.source, htmlBlockRegex.flags);
3433

3534
while ((match = regex.exec(content)) !== null) {
36-
matches.push({ block: match[0], index: match.index });
35+
matches.push({
36+
block: match[0],
37+
index: match.index,
38+
});
3739
}
3840

3941
const prettierConfig = await prettier.resolveConfig(filePath);
@@ -44,7 +46,10 @@ const formatHtmlBlocks = async (content: string, filePath: string) => {
4446
let formattedBlock: string;
4547
try {
4648
formattedBlock = (
47-
await prettier.format(block, { parser: 'html', ...prettierConfig })
49+
await prettier.format(block, {
50+
parser: 'html',
51+
...prettierConfig,
52+
})
4853
).trim();
4954
} catch (e: any) {
5055
console.warn(`⚠️ Failed to format block:\n${block}\nError: ${e.message}`);

0 commit comments

Comments
 (0)