File tree Expand file tree Collapse file tree 1 file changed +26
-1
lines changed Expand file tree Collapse file tree 1 file changed +26
-1
lines changed Original file line number Diff line number Diff line change @@ -67,7 +67,32 @@ get_ignore_words_for_file() {
67
67
# Use this to filter out lines we don't wanna consider in spell-check - slugs, imports, and img src JSX elements
68
68
preprocess_file () {
69
69
local file=$1
70
- sed -E ' s/\{#[^}]*\}//g' " $file " | grep -Ev ' ^(slug:|import [[:alnum:]_, {}*]+ from .+;?|<img src=\{[^}]+\})'
70
+
71
+ # Remove YAML frontmatter (everything between the first --- and second --- lines)
72
+ # Then apply other existing filters
73
+ awk '
74
+ BEGIN {
75
+ in_frontmatter = 0
76
+ frontmatter_ended = 0
77
+ }
78
+ # If first line is ---, we are starting frontmatter
79
+ /^---$/ && NR == 1 {
80
+ in_frontmatter = 1
81
+ next
82
+ }
83
+ # If we encounter --- while in frontmatter, end it
84
+ /^---$/ && in_frontmatter {
85
+ in_frontmatter = 0
86
+ frontmatter_ended = 1
87
+ next
88
+ }
89
+ # Print lines only if not in frontmatter
90
+ !in_frontmatter { print }
91
+ ' " $file " \
92
+ | sed -E ' s/\{#[^}]*\}//g' \
93
+ | sed -E ' s/<[A-Za-z0-9_]+svg[^>]*\/?>//g' \
94
+ | sed -E ' s/<Image[^>]*\/?>//g' \
95
+ | grep -Ev ' (^[[:space:]]*(slug:|<img src=\{[^}]+\})|^import .* from .*)'
71
96
}
72
97
# List of files to ignore
73
98
IGNORE_LIST=(
You can’t perform that action at this time.
0 commit comments