remove nunjucks template URLs from the target-blank query

This commit is contained in:
Erik Krogh Kristensen
2021-08-02 17:02:40 +02:00
parent bbbbeda7c3
commit f719e0ca1b
2 changed files with 6 additions and 3 deletions

View File

@@ -43,8 +43,8 @@ predicate hasDynamicHrefHostAttributeValue(DOM::ElementDefinition elem) {
url.regexpMatch(Templating::getDelimiterMatchingRegexpWithPrefix("[^?#]*")) and
// ... that does not start with a fixed host or a relative path (common formats)
not url.regexpMatch("(?i)((https?:)?//)?[-a-z0-9.]*/.*") and
// .. that is not a call to `url_for` in a Flask application
not url.regexpMatch("\\{\\{\\s*url_for.*")
// .. that is not a call to `url_for` in a Flask / nunjucks application
not url.regexpMatch("\\{\\{\\s*url(_for)?\\(.+\\).*")
)
)
}