3
0
mirror of https://github.com/larvit/adf-codec.git synced 2026-11-13 12:18:28 +01:00
Files
adf-codec/src/backtick-runs.ts
T

10 lines
243 B
TypeScript

export function longestBacktickRun(text: string): number {
let longest = 0
let current = 0
for (const character of text) {
current = character === '`' ? current + 1 : 0
longest = Math.max(longest, current)
}
return longest
}