Skip to content

Commit

Permalink
Collapse around hyphen
Browse files Browse the repository at this point in the history
  • Loading branch information
wpears committed Mar 12, 2024
1 parent 39b4f4b commit b8cd902
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions .github/workflows/sed.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
#!/usr/bin/env bash

sed -e '/^ *$/d' `# Whitespace-only or empty lines` \
-e 's/ / /g' `# nbsp to space` \
-e 's/–/-/g' `# endash to hyphen` \
-e "s/’/'/g" `# apostrophe to single quote` \
-e 's/\s—\s/—/g' `# collapse whitespace around emdash`
sed -E\
-e '/^ *$/d' `# Whitespace-only or empty lines` \
-e 's/ / /g' `# nbsp to space` \
-e 's/–/-/g' `# endash to hyphen` \
-e "s/’/'/g" `# apostrophe to single quote` \
-e 's/[[:blank:]]([—-])[[:blank:]]/\1/g' `# collapse whitespace around emdash and hyphen`

0 comments on commit b8cd902

Please sign in to comment.