From 41650203c32e179e5f3cf89e176ef6caccba05d9 Mon Sep 17 00:00:00 2001 From: "Avi Halachmi (:avih)" Date: Fri, 23 Jul 2021 20:31:15 +0300 Subject: sub: sub-filter-regex and jsre: support ass-to-plaintext Using --sub-filter-regex-plain (default:no) The ass-to-plaintext functionality already existed at sd_ass.c, but it's internal and uses a private buffer type, so a trivial utility wrapper was added with standard char*/bstr interface. The plaintext can be multi-line, and the multi-line regexp flag is now always set, but only affects plaintext (the ASS source is one line). --- DOCS/man/options.rst | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'DOCS/man/options.rst') diff --git a/DOCS/man/options.rst b/DOCS/man/options.rst index c540400c74..c08161f338 100644 --- a/DOCS/man/options.rst +++ b/DOCS/man/options.rst @@ -2804,7 +2804,7 @@ Subtitles List items are matched in order. If a regular expression matches, the process is stopped, and the subtitle line is discarded. The text matched - against is, currently, always the ``Text`` field of ASS events (if the + against is, by default, the ``Text`` field of ASS events (if the subtitle format is different, it is always converted). This may include formatting tags. Matching is case-insensitive, but how this is done depends on the libc, and most likely works in ASCII only. It does not work on @@ -2831,6 +2831,12 @@ Subtitles Shares/affected-by all ``--sub-filter-regex-*`` control options (see below), and also experimental. Requires only JavaScript support. +``--sub-filter-regex-plain=`` + Whether to first convert the ASS "Text" field to plain-text (default: no). + This strips ASS tags and applies ASS directives, like ``\N`` to new-line. + If the result is multi-line then the regexp anchors ``^`` and ``$`` match + each line, but still any match discards all lines. + ``--sub-filter-regex-warn=`` Log dropped lines with warning log level, instead of verbose (default: no). Helpful for testing. -- cgit v1.2.3