Skip to content

Commit

Permalink
#787 support CRLF for markdown script
Browse files Browse the repository at this point in the history
  • Loading branch information
lawrenceching committed Apr 25, 2024
1 parent 5fd3d8a commit 81fe408
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
test/fixtures/markdown-crlf.md eol=crlf
6 changes: 6 additions & 0 deletions test/cli.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,12 @@ describe('cli', () => {
await $`node build/cli.js test/fixtures/markdown.md`
})

test('markdown scripts are working for CRLF', async () => {

let p = await $`node build/cli.js test/fixtures/markdown-crlf.md`
assert.ok(p.stdout.includes('Hello, world!'))
})

test('exceptions are caught', async () => {
let out1 = await $`node build/cli.js <<<${'await $`wtf`'}`.nothrow()
assert.match(out1.stderr, /Error:/)
Expand Down
3 changes: 3 additions & 0 deletions test/fixtures/markdown-crlf.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```js
echo`Hello, world!`
```

0 comments on commit 81fe408

Please sign in to comment.