diff --git a/GoodEnoughRules/Public/Measure-GremlinCharacter.ps1 b/GoodEnoughRules/Public/Measure-GremlinCharacter.ps1 index 62e035f..202764f 100644 --- a/GoodEnoughRules/Public/Measure-GremlinCharacter.ps1 +++ b/GoodEnoughRules/Public/Measure-GremlinCharacter.ps1 @@ -40,7 +40,10 @@ function Measure-GremlinCharacter { [char]0x200B = @{ Description = 'zero width space'; Severity = 'Error' } [char]0x200C = @{ Description = 'zero width non-joiner'; Severity = 'Warning' } [char]0x200E = @{ Description = 'left-to-right mark'; Severity = 'Error' } + [char]0x2011 = @{ Description = 'non-breaking hyphen'; Severity = 'Warning' } + [char]0x2012 = @{ Description = 'figure dash'; Severity = 'Warning' } [char]0x2013 = @{ Description = 'en dash'; Severity = 'Warning' } + [char]0x2014 = @{ Description = 'em dash'; Severity = 'Warning' } [char]0x2018 = @{ Description = 'left single quotation mark'; Severity = 'Warning' } [char]0x2019 = @{ Description = 'right single quotation mark'; Severity = 'Warning' } [char]0x201C = @{ Description = 'left double quotation mark'; Severity = 'Warning' } diff --git a/docs/en-US/Measure-GremlinCharacter.md b/docs/en-US/Measure-GremlinCharacter.md index f60e62e..946affd 100644 --- a/docs/en-US/Measure-GremlinCharacter.md +++ b/docs/en-US/Measure-GremlinCharacter.md @@ -26,7 +26,7 @@ Severity levels reflect how dangerous the character is: - **Error** - Bidirectional overrides, zero-width spaces, and control characters that can actively obscure code intent or enable Trojan-source attacks. -- **Warning** - Typographic characters (curly quotes, en dash) that are unlikely +- **Warning** - Typographic characters (curly quotes, non-breaking hyphen, figure dash, en dash, em dash) that are unlikely to be intentional in source code and may cause parse errors. - **Information** - Characters like non-breaking spaces that are rarely intentional but generally harmless. diff --git a/tests/Measure-GremlinCharacter.tests.ps1 b/tests/Measure-GremlinCharacter.tests.ps1 index e1bd3fb..7f765f6 100644 --- a/tests/Measure-GremlinCharacter.tests.ps1 +++ b/tests/Measure-GremlinCharacter.tests.ps1 @@ -23,7 +23,10 @@ Describe 'Measure-GremlinCharacter' { @{ Char = [char]0x200B; CodePoint = '200B'; Description = 'zero width space'; Severity = 'Error' } @{ Char = [char]0x200C; CodePoint = '200C'; Description = 'zero width non-joiner'; Severity = 'Warning' } @{ Char = [char]0x200E; CodePoint = '200E'; Description = 'left-to-right mark'; Severity = 'Error' } + @{ Char = [char]0x2011; CodePoint = '2011'; Description = 'non-breaking hyphen'; Severity = 'Warning' } + @{ Char = [char]0x2012; CodePoint = '2012'; Description = 'figure dash'; Severity = 'Warning' } @{ Char = [char]0x2013; CodePoint = '2013'; Description = 'en dash'; Severity = 'Warning' } + @{ Char = [char]0x2014; CodePoint = '2014'; Description = 'em dash'; Severity = 'Warning' } @{ Char = [char]0x2018; CodePoint = '2018'; Description = 'left single quotation mark'; Severity = 'Warning' } @{ Char = [char]0x2019; CodePoint = '2019'; Description = 'right single quotation mark'; Severity = 'Warning' } @{ Char = [char]0x201C; CodePoint = '201C'; Description = 'left double quotation mark'; Severity = 'Warning' }