Mangler.Transform (mangler v0.2.0) View Source

Helper to substitute diacritics with their ASCII equivalents

Link to this section Summary

Functions

Substitute diacritics in the given string with their ASCII equivalents. This function works by performing NFD normalization on the graphemes in the string. It then removes any non-words from the string. Due to this, an allowlist must be provided to keep any non-word characters intact.

Link to this section Types

Specs

opts() :: [{:allow, [String.t()]}]

Link to this section Functions

Link to this function

substitute_diacritics(string, opts \\ [])

View Source

Specs

substitute_diacritics(String.t(), opts()) :: String.t()

Substitute diacritics in the given string with their ASCII equivalents. This function works by performing NFD normalization on the graphemes in the string. It then removes any non-words from the string. Due to this, an allowlist must be provided to keep any non-word characters intact.