Skip to content

Commit

Permalink
tighter code fenced blocks in usage
Browse files Browse the repository at this point in the history
  • Loading branch information
isaacs committed Jun 3, 2024
1 parent c80dc2f commit 2dffa70
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 10 deletions.
4 changes: 2 additions & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1434,15 +1434,15 @@ const normalize = (s: string, pre = false) => {
/* c8 ignore next */
const i = isFinite(si) ? si : 0
return (
'\n```\n' +
'\n```' +
s
.split('\n')
.map(
s =>
`\u200b${s.substring(i)}`,
)
.join('\n') +
'\n```\n'
'```\n'
)
}
return (
Expand Down
12 changes: 4 additions & 8 deletions tap-snapshots/test/basic.ts.test.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -226,8 +226,7 @@ Usage:
--xyz=<n> Sometimes, there's a number and you care about doing something
special with that number, like
\`\`\`
\`\`\`​
​console.log(
​ heloo, number
Expand All @@ -236,16 +235,13 @@ Usage:
​Ok, goodbye then.
​)
\`\`\`
​\`\`\`
this is some stuff that happens later
\`\`\`
\`\`\`​
​just one line, no indentation
\`\`\`
​\`\`\`
nothing in this one:
\`\`\`
Expand Down

0 comments on commit 2dffa70

Please sign in to comment.