Add a backslash before predefined characters

How to add a backslash before predefined characters in a string in the AnQi CMS template?

addslashesThe filter can specify a predefined character by adding a backslash in front of it. These characters are the single quote (’), double quote (”), and backslash (\).

How to use

addslashesHow to use filters:

{{ obj|addslashes }}

For example安企\"CMS\"If you add a backslash to the predefined characters in it, you can write it like this:

{{ "安企\"CMS\""|addslashes|safe }}
# 显示结果
安企\"CMS\"

Sample Demo

{{ "安企CMS"|addslashes|safe }}
{{ "This is \\a Test. \"Yep\". 'Yep'."|addslashes|safe }}
# 显示结果
安企CMS
This is \\a Test. \"Yep\". \'Yep\'.