From: Lady Date: Mon, 1 Jan 2024 22:18:49 +0000 (-0500) Subject: Provide a mechanism to override parser media types X-Git-Tag: 0.2.0~1 X-Git-Url: https://git.ladys.computer/Shushe/commitdiff_plain/51a6b89322b4148793c40398443029bceac8a315 Provide a mechanism to override parser media types If `@书社:supported-media-types` is present on the root element of a parser, the normal media type detection is disabled and the value of the attribute is used instead. --- diff --git a/README.markdown b/README.markdown index f2cfdd9..6870c4d 100644 --- a/README.markdown +++ b/README.markdown @@ -244,6 +244,9 @@ For example, the trivial `text/plain` parser is defined as follows :⁠— the set of allowed plaintext file types. Multiple such `` elements may be provided in a single parser, for example if the parser supports multiple media types. +Alternatively, you can set the `@书社:supported-media-types` attribute + on the root element of the parser to override media type support + detection. It is **strongly recommended** that all templates in parsers other than those described above be namespaced (by `@name` or `@mode`), to avoid diff --git a/lib/parser2types.xslt b/lib/parser2types.xslt index ee107e4..1dfa90c 100644 --- a/lib/parser2types.xslt +++ b/lib/parser2types.xslt @@ -2,7 +2,7 @@