fix: handle CRLF in snippet plugin

closes #3499
pull/3500/head
Divyansh Singh 11 months ago
parent 3b860f9e8c
commit 5811b62657

@ -170,10 +170,10 @@ export const snippetPlugin = (md: MarkdownIt, srcDir: string) => {
return fence(...args)
}
let content = fs.readFileSync(src, 'utf8')
let content = fs.readFileSync(src, 'utf8').replace(/\r\n/g, '\n')
if (regionName) {
const lines = content.split(/\r?\n/)
const lines = content.split('\n')
const region = findRegion(lines, regionName)
if (region) {

Loading…
Cancel
Save