mirror of
https://github.com/harvard-edge/cs249r_book.git
synced 2026-03-08 23:03:55 -05:00
Adds rule to discourage em dashes
Adds a Vale rule to warn against the use of em dashes in formal writing. It suggests using commas or rephrasing as alternative solutions. The rule is configurable to also detect spaced em dashes or incorrect hyphen usage.
This commit is contained in:
16
.vale/styles/textbook/Dashes.yml
Normal file
16
.vale/styles/textbook/Dashes.yml
Normal file
@@ -0,0 +1,16 @@
|
||||
extends: substitution
|
||||
message: "Avoid em dashes (—) in formal writing; use commas or rephrase."
|
||||
level: warning
|
||||
ignorecase: false
|
||||
scope: raw
|
||||
nonword: true
|
||||
swap:
|
||||
# Match an em dash between words/clauses, suggest using commas
|
||||
'\b[^—\n]+—[^—\n]+\b': ', ... ,'
|
||||
|
||||
# Optional: also match spaced em dash style (— on both sides)
|
||||
# '\s+—\s+': ', '
|
||||
|
||||
# Optional: flag improper use of hyphen instead of dash (uncomment to activate)
|
||||
# '\s+-\s+': '— (em dash) or comma'
|
||||
|
||||
Reference in New Issue
Block a user