5
0
Fork 0
mirror of https://0xacab.org/sutty/sutty synced 2024-11-22 02:56:21 +00:00

feat: eliminar tildes de una string, sin transliterar

usamos esto porque es más rápido y podemos tener un proceso similar en
js sin implementar transliteración
This commit is contained in:
f 2024-05-17 15:00:08 -03:00
parent c75deaf030
commit 8fe964686b
No known key found for this signature in database
2 changed files with 13 additions and 0 deletions

View file

@ -0,0 +1,12 @@
# frozen_string_literal: true
module CoreExtensions
module String
# Elimina tildes
module RemoveDiacritics
def remove_diacritics
unicode_normalize(:nfd).gsub(/[^\x00-\x7F]/, '')
end
end
end
end

View file

@ -1,6 +1,7 @@
# frozen_string_literal: true
String.include CoreExtensions::String::StripTags
String.include CoreExtensions::String::RemoveDiacritics
Jekyll::Document.include CoreExtensions::Jekyll::Document::Path
Jekyll::DataReader.include Jekyll::Readers::DataReaderDecorator