From aa115d07c84cea0de160dee598b2846b78dfd8fe Mon Sep 17 00:00:00 2001 From: Avinash Sonawane Date: Thu, 6 Jan 2022 11:49:49 +0530 Subject: [PATCH] Improvement to docs (#698) * Docs : Clarify `addslashes` filter * Docs : Clarify `slugify` filter --- docs/content/docs/_index.md | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/docs/content/docs/_index.md b/docs/content/docs/_index.md index 720b4188..7a1ade57 100644 --- a/docs/content/docs/_index.md +++ b/docs/content/docs/_index.md @@ -789,21 +789,20 @@ the `from` string replaced with the `to` string. Example: `{{ name | replace(from="Robert", to="Bob")}}` #### addslashes -Adds slashes before quotes. +Adds slashes before single quote (`'`), double quote (`"`) and slash (`\`) chars. Example: `{{ value | addslashes }}` -If value is "I'm using Tera", the output will be "I\\'m using Tera". +If value is \`Alice said, "I'm using \ in Tera"\`, the output will be \`Alice said, \\"I\\'m using \\\\ in Tera\\"\`. #### slugify Only available if the `builtins` feature is enabled. -Transforms a string into ASCII, lowercases it, trims it, converts spaces to hyphens and -removes all characters that are not numbers, lowercase letters or hyphens. +Transforms a string into ASCII, lowercases it, trims it, converts all characters that are not numbers or lowercase letters to hyphens, replaces continuous sequence of hyphens with a single hyphen and removes leading and trailing hyphens if any. Example: `{{ value | slugify }}` -If value is "-Hello world! ", the output will be "hello-world". +If value is " -This-- Is तेरा! ", the output will be "this-is-teraa". #### title Capitalizes each word inside a sentence.