searxng/searx/help/en
Martin Fischer 244ffef315 [help] substitute variables with string.Template
Previously help pages could link to instance-specific pages
with e.g. [search engines][url_for:preferences] which was
possible because searx.user_help was prefixing the Markdown:

[url_for:preferences]: /preferences

There are two problems with this:

1. typos in the Markdown files could go by unnoticed
   (since Markdown treats [foo][doesntexist] as regular text)

2. it doesn't let Markdown append their own query string
   (which would however be handy to link example search
    queries to the search page)

This commit addresses both of these problems by using
string.Template from the Python standard library.

Why don't we use Jinja2 for this? Well Jinja2 would be overkill.
We don't need any logic in the user documentation. And in the future
we might outsource the user documentation translation to Weblate,
in which case not permitting any logic in them is more secure.
2022-02-05 10:35:32 +01:00
..
about.md [help] substitute variables with string.Template 2022-02-05 10:35:32 +01:00