Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UI - Extract text multiline helper #1903

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion changedetectionio/processors/text_json_diff.py
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,8 @@ def run(self, uuid, skip_when_checksum_same=True, preferred_proxy=None):
# incase they specified something in '/.../x'
if re.search(PERL_STYLE_REGEX, s_re, re.IGNORECASE):
regex = html_tools.perl_style_slash_enclosed_regex_to_options(s_re)
result = re.findall(regex.encode('utf-8'), stripped_text_from_html)
# Both the regex (r) and (stripped_text_from_html) should be bytes by now
result = re.findall(rf"{regex}".encode('utf-8'), stripped_text_from_html)

for l in result:
if type(l) is tuple:
Expand Down
14 changes: 6 additions & 8 deletions changedetectionio/templates/edit.html
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@
<div class="pure-control-group inline-radio">
{{ render_checkbox_field(form.ignore_status_codes) }}
</div>
<fieldset id="webdriver-override-options">
<fieldset id="webdriver-override-options" class="hideable show-html_webdriver">
<div class="pure-control-group">
{{ render_field(form.webdriver_delay) }}
<div class="pure-form-message-inline">
Expand All @@ -139,20 +139,17 @@
{% endif %}
</div>
</div>
</fieldset>
<fieldset class="hideable show-html_webdriver">
<div class="pure-control-group">
{{ render_field(form.webdriver_js_execute_code) }}
<div class="pure-form-message-inline">
Run this code before performing change detection, handy for filling in fields and other actions <a href="https://github.com/dgtlmoon/changedetection.io/wiki/Run-JavaScript-before-change-detection">More help and examples here</a>
</div>
</div>
</fieldset>
<fieldset class="pure-group" id="requests-override-options">
{% if not playwright_enabled %}
<div class="pure-form-message-inline">
<strong>Request override is currently only used by the <i>Basic fast Plaintext/HTTP Client</i> method.</strong>
</div>
{% endif %}
<div class="pure-control-group" id="request-method">
<fieldset class="pure-group hideable show-html_requests" id="requests-override-options">
<div class="pure-control-group " id="request-method">
{{ render_field(form.method) }}
</div>
<div class="pure-control-group" id="request-headers">
Expand Down Expand Up @@ -384,6 +381,7 @@ <h3>Text filtering</h3>
<li>Extracts text in the final output (line by line) after other filters using regular expressions or string match;
<ul>
<li>Regular expression &dash; example <code>/reports.+?2022/i</code></li>
<li>Regular expression to match across lines &dash; example <code>/FromHere.+?ToHere/is</code></li>
<li>Don't forget to consider the white-space at the start of a line <code>/.+?reports.+?2022/i</code></li>
<li>Use <code>//(?aiLmsux))</code> type flags (more <a href="https://docs.python.org/3/library/re.html#index-15">information here</a>)<br></li>
<li>Keyword example &dash; example <code>Out of stock</code></li>
Expand Down