Skip to content

Commit

Permalink
Additional changes to spellchecker.
Browse files Browse the repository at this point in the history
  • Loading branch information
shefulloflight committed Feb 6, 2025
1 parent 6857001 commit e1a8e4e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions spellcheck.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,10 @@ def preprocess_content(content, filename, allowlist_words)
end

content
.gsub(/\{%\s*capture\s+[\s\S]*?%\}[\s\S]*?\{%\s*endcapture\s*%\}/m, '') # Ignore Liquid capture tags comprised entirely of JSON
.gsub(/\{%\s*capture\s+[^\s]+\s*%\}/, ' ') # Ignore variable capture statements
.gsub(/content=\S+\s+%}/, ' ') # Ignore usage of captured variables
.gsub(/\[([^\]]+)\]\([^)]+\)/, '\1') # Ignore Markdown links, keeping only the text within square brackets
# .gsub(/{%\s*include\s+content-reuse\/[^\n%]+\.md\s*%}/, ' ')
.gsub(/{%\s*include\s+content-reuse\/[^\n%]+\.md(?:\s+\w+="[^"]*")*\s*%}/, ' ') # Ignore transcludes
.gsub(/Gävle/, ' ') # Ignore special cases
.gsub(/dæmons/i, ' ')
Expand Down Expand Up @@ -54,15 +56,13 @@ def preprocess_content(content, filename, allowlist_words)
.gsub(/C-\d+[A-Za-z]*\b/, ' ') # Ignore `C-<N>T` patternws
.gsub(/K-\d+[A-Za-z]*\b/, ' ') # Ignore `K-<N>T` patterns
.gsub(/ConnectX-\d+\b/, ' ') # Ignore `ConnectX-<N>` patterns
.gsub(/{%\s*capture\s+[^%]+%}\s*([\s\S]*?){%\s*endcapture\s*%}/m, ' ')
.gsub(/{%\s*if page\.[^%]+%}\s*([\s\S]*?)(?:{%\s*(?:elsif[^%]+|else)\s*%}\s*([\s\S]*?))?{%\s*endif\s*%}/m, ' ')
.gsub(/{%\s*unless[^%]+%}\s*([\s\S]*?){%\s*endunless\s*%}/m, ' ') # Ignore Liquid unless conditionals
.gsub(/{%\s*include\s+rfc\.html\s+rfc='[^']*'\s*%}/, ' ') # Ignore Liquid RFC links
.gsub(/{%\s*include\s+qq\.html\s+command="[^']*"\s*%}/, ' ') # Ignore Liquid qq CLI links
.gsub(/{%\s*assign\s+\w+\s*=.*?%}/m, ' ') # Ignore Liquid {% assign %} tags
.gsub(/{%\s*comment\s*%}.*?{%\s*endcomment\s*%}/m, ' ') # Ignore Liquid comments
.gsub(/{%\s*include image\.html .*?%}/m, ' ') # Ignore Liquid images
#.gsub(/{%\s*include shared_image\.html .*?%}/m, ' ') # Ignore Liquid shared images
.gsub(/{%\s*include\s+shared_image\.html[\s\S]+?%}/, ' ')
.gsub(/\{\{.+?\}\}/, ' ') # Ignore Liquid variables
.gsub(/var[[:alpha:]]*/, ' ') # Ignore local variables in YAML
Expand Down

0 comments on commit e1a8e4e

Please sign in to comment.