Skip to content

Commit

Permalink
chore: use newline escape instead of trimStart
Browse files Browse the repository at this point in the history
  • Loading branch information
brc-dd committed Dec 5, 2024
1 parent 2ca945c commit 46b4342
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions scripts/patch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ await ensureDir('vendor')
await Deno.writeTextFile('./vendor/prettier-plugin-markdown.js', transformed)
await Deno.writeTextFile(
'./vendor/prettier-plugin-markdown.d.ts',
`
`\
import type { Parser, Plugin, Printer } from 'prettier'
declare const md: Plugin & {
Expand All @@ -33,5 +33,5 @@ declare const md: Plugin & {
}
export default md
`.trimStart(),
`,
)
6 changes: 3 additions & 3 deletions tests/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { assertEquals } from '@std/assert'

Deno.test('plugin', async (t) => {
await t.step('should format vue in markdown', async () => {
const code = `
const code = `\
---
yaml: frontmatter
---
Expand Down Expand Up @@ -86,7 +86,7 @@ attrs {target="_self" #id}
attrs {target="_self"}
`

const expected = `
const expected = `\
---
yaml: frontmatter
---
Expand Down Expand Up @@ -190,7 +190,7 @@ comment
attrs {target="_self" #id}
attrs {target="_self"}
`.trimStart()
`

const result = await prettier.format(code, {
parser: 'markdown',
Expand Down

0 comments on commit 46b4342

Please sign in to comment.