diff --git a/content/terms/how-to/apply-filters.md b/content/terms/how-to/apply-filters.md index b250e8a6..390e74a8 100644 --- a/content/terms/how-to/apply-filters.md +++ b/content/terms/how-to/apply-filters.md @@ -109,9 +109,11 @@ For filters that don’t require parameters, add the filter name as a string: } ``` +Built-in filters declared this way use their default parameters. For example, `removeQueryParams` alone removes the well-known tracking parameters described in its [reference]({{< relref "terms/reference/built-in-filters/#ref-removequeryparams" >}}). + ### Filter with parameters -For filters that take parameters, use an object format, for example with the built-in filter `removeQueryParams` to remove query parameters from URLs: +For filters that take parameters, use an object format, for example with the built-in filter `removeQueryParams` to choose which query parameters to remove from URLs: ```json { diff --git a/content/terms/reference/built-in-filters.md b/content/terms/reference/built-in-filters.md index c3075330..8bcf9952 100644 --- a/content/terms/reference/built-in-filters.md +++ b/content/terms/reference/built-in-filters.md @@ -8,9 +8,24 @@ This reference details all available built-in [filters]({{< relref "terms/explan {{< refItem name="removeQueryParams" - description="Removes specified query parameters from URLs in links and images." + description="Removes query parameters from URLs in links and images. Without parameters, removes well-known tracking parameters such as `utm_source` or `fbclid`, listed in the [engine source code](https://github.com/OpenTermsArchive/engine/blob/main/src/archivist/extract/exposedFilters.js). Declaring parameters replaces this default list." >}} +With the default parameters: + +```json +"filter": [ + "removeQueryParams" +] +``` + +```diff +-
Read the list of our affiliates.
++Read the list of our affiliates.
+``` + +With explicit parameters: + ```json "filter": [ { @@ -24,4 +39,38 @@ This reference details all available built-in [filters]({{< relref "terms/explan +Read the list of our affiliates.
``` +To keep the default parameters and remove additional ones, declare the filter twice, as filters are applied in order: + +```json +"filter": [ + "removeQueryParams", + { + "removeQueryParams": ["ref"] + } +] +``` + +```diff +-Read the list of our affiliates.
++Read the list of our affiliates.
+``` + +{{< /refItem >}} + +{{< refItem + name="convertSpacesToStandard" + description="Replaces Unicode space separators, such as non-breaking spaces or narrow no-break spaces, with a regular space in text content." +>}} + +```json +"filter": [ + "convertSpacesToStandard" +] +``` + +```diff +-Read the list of our affiliates.
++Read the list of our affiliates.
+``` + {{< /refItem >}}