From f8ad7d8035492fd544b5968800804ea2519601db Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dobros=C5=82aw=20=C5=BBybort?= Date: Fri, 10 May 2013 15:23:01 +0200 Subject: [PATCH] Add: ability to set custom substitution map --- slug.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/slug.go b/slug.go index 5001e42..d388223 100644 --- a/slug.go +++ b/slug.go @@ -11,6 +11,11 @@ import ( "strings" ) +var ( + // Custom substitution map + CustomSub map[rune]string +) + //============================================================================= // Make returns slug generated from provided string. Will use "en" as language @@ -37,6 +42,7 @@ func MakeLang(s string, lang string) (slug string) { } slug = substitute(slug, defaultSub) + slug = substitute(slug, CustomSub) slug = unidecode.Unidecode(slug)