Skip to content

Commit

Permalink
Remove blank lines from Nunjucks code in Examples
Browse files Browse the repository at this point in the history
  • Loading branch information
domoscargin committed Sep 1, 2022
1 parent 8bae063 commit 983e864
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion lib/file-helper.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,15 @@ exports.getNunjucksCode = path => {
// Omit any `{% extends "foo.njk" %}` nunjucks code, because we extend
// templates that only exist within the Design System – it's not useful to
// include this in the code we expect others to copy.
let content = parsedFile.content.replace(
let content = parsedFile.content
.replace(
/{%\s*extends\s*\S*\s*%}\s+/,
''
)
.replace(
/^\s*[\r\n]/gm,
''
)

return content
}
Expand Down

0 comments on commit 983e864

Please sign in to comment.