diff --git a/README.md b/README.md index f32a41a..a897cc2 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # ObsoHTML, the Obsolete HTML Checker -ObsoHTML is a Node.js script designed to scan HTML, PHP, JavaScript, and TypeScript files for obsolete or proprietary HTML attributes and elements (in scripts, it would catch JSX syntax). It helps you identify and update deprecated HTML code to be more sure to use web standards. +ObsoHTML is a Node.js script designed to scan HTML, PHP, Nunjucks, Twig, JavaScript, and TypeScript files for obsolete or proprietary HTML attributes and elements (in scripts, it would catch JSX syntax). It helps you identify and update deprecated HTML code to be more sure to use web standards. ## Usage diff --git a/bin/obsohtml.js b/bin/obsohtml.js index 9deb731..9df74bb 100755 --- a/bin/obsohtml.js +++ b/bin/obsohtml.js @@ -78,7 +78,7 @@ function walkDirectory(directory, verbose) { if (file !== 'node_modules') { walkDirectory(fullPath, verbose); } - } else if (fullPath.endsWith('.html') || fullPath.endsWith('.htm') || fullPath.endsWith('.php') || fullPath.endsWith('.js') || fullPath.endsWith('.ts')) { + } else if (fullPath.endsWith('.html') || fullPath.endsWith('.htm') || fullPath.endsWith('.php') || fullPath.endsWith('.njk') || fullPath.endsWith('.twig') || fullPath.endsWith('.js') || fullPath.endsWith('.ts')) { findObsolete(fullPath); } } catch (err) { diff --git a/bin/obsohtml.test.js b/bin/obsohtml.test.js index 94479d6..9d26936 100644 --- a/bin/obsohtml.test.js +++ b/bin/obsohtml.test.js @@ -7,6 +7,7 @@ describe('ObsoHTML', () => { const tempFile = path.join(tempDir, 'test.html'); const tempFileWithAttributes = path.join(tempDir, 'test_with_attributes.html'); const tempFileWithMinimizedAttributes = path.join(tempDir, 'test_with_minimized_attributes.html'); + const tempTwigFile = path.join(tempDir, 'test.twig'); beforeAll(() => { // Create a temporary directory and files @@ -16,6 +17,7 @@ describe('ObsoHTML', () => { fs.writeFileSync(tempFile, '