Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
A
Admin
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
osuny
Admin
Commits
6c0d1e2f
Unverified
Commit
6c0d1e2f
authored
5 months ago
by
Arnaud Levy
Committed by
GitHub
5 months ago
Browse files
Options
Downloads
Patches
Plain Diff
doomed (#2321)
parent
29d31732
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
app/services/static.rb
+12
-11
12 additions, 11 deletions
app/services/static.rb
with
12 additions
and
11 deletions
app/services/static.rb
+
12
−
11
View file @
6c0d1e2f
class
Static
DOOMED_CHARACTERS
=
[
"
\u
2028"
,
# https://github.com/noesya/pixelis-rapportglobal2023/issues/1
"
\u
0094"
,
"
\u
008d"
,
# https://github.com/osunyorg/lacriee-site/actions/runs/9242403369
"
\u
009D"
,
"
\u
0090"
,
# 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
(
"'
\;
"
,
"'"
)
# /u2028 breaks Hugo rendering
# https://github.com/noesya/pixelis-rapportglobal2023/issues/1
code
=
code
.
remove
(
"
\u
2028"
.
encode
(
'utf-8'
))
# /u0092 also breaks everything, should be an apostrophe
# /u0092 breaks everything, should be an apostrophe
code
=
code
.
gsub
(
"
\u
0092"
.
encode
(
'utf-8'
),
"'"
)
# Same operation with the problematic character itself
code
=
code
.
gsub
(
""
,
"'"
)
# /u0094
code
=
code
.
remove
(
"
\u
0094"
.
encode
(
'utf-8'
))
# /u008d
# https://github.com/osunyorg/lacriee-site/actions/runs/9242403369
code
=
code
.
remove
(
"
\u
008d"
.
encode
(
'utf-8'
))
# /u009D
code
=
code
.
remove
(
"
\u
009D"
.
encode
(
'utf-8'
))
# Doomed characters break Hugo compilation
DOOMED_CHARACTERS
.
each
do
|
character
|
code
=
code
.
remove
(
character
.
encode
(
'utf-8'
))
end
code
end
end
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment