heraldofsolace / VimHelpBot

VimHelpBot is a bot that replies to r/vim and r/neovim comments with link to Vim Help page
GNU General Public License v3.0
46 stars 2 forks source link

Remove unnecessary escaping #17

Closed rnevius closed 4 years ago

rnevius commented 4 years ago

Also adds a test case for :help /\<.

Resolves #16

heraldofsolace commented 4 years ago

Removing the escaping will cause the _ and % to get picked up by the SQL query and will break searching for tags that contain those two.

heraldofsolace commented 4 years ago

We could just escape the backslash also

text_escaped = text.replace("\\", "\\\\").replace("%", "\\%").replace("_", "\\_")