Skip to content
Snippets Groups Projects
Unverified Commit 6c0d1e2f authored by Arnaud Levy's avatar Arnaud Levy Committed by GitHub
Browse files

doomed (#2321)

parent 29d31732
No related branches found
No related tags found
No related merge requests found
class Static
DOOMED_CHARACTERS = [
"\u2028", # https://github.com/noesya/pixelis-rapportglobal2023/issues/1
"\u0094",
"\u008d", # https://github.com/osunyorg/lacriee-site/actions/runs/9242403369
"\u009D",
"\u0090", # https://github.com/osunyorg/marionrebier-beelearning/actions/runs/11340775264
]
def self.clean_path(path)
path += '/' unless path.end_with? '/'
path.gsub("//", '/')
......@@ -40,20 +47,14 @@ class Static
def self.remove_problematic_characters(code)
# We don't want ' in the frontmatters!
code = code.gsub("&#39\;", "'")
# /u2028 breaks Hugo rendering
# https://github.com/noesya/pixelis-rapportglobal2023/issues/1
code = code.remove("\u2028".encode('utf-8'))
# /u0092 also breaks everything, should be an apostrophe
# /u0092 breaks everything, should be an apostrophe
code = code.gsub("\u0092".encode('utf-8'), "'")
# Same operation with the problematic character itself
code = code.gsub("’", "'")
# /u0094
code = code.remove("\u0094".encode('utf-8'))
# /u008d
# https://github.com/osunyorg/lacriee-site/actions/runs/9242403369
code = code.remove("\u008d".encode('utf-8'))
# /u009D
code = code.remove("\u009D".encode('utf-8'))
# Doomed characters break Hugo compilation
DOOMED_CHARACTERS.each do |character|
code = code.remove(character.encode('utf-8'))
end
code
end
end
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment