File tree Expand file tree Collapse file tree 2 files changed +6
-3
lines changed
test/query-tests/DOM/TargetBlank Expand file tree Collapse file tree 2 files changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -43,8 +43,8 @@ predicate hasDynamicHrefHostAttributeValue(DOM::ElementDefinition elem) {
4343 url .regexpMatch ( Templating:: getDelimiterMatchingRegexpWithPrefix ( "[^?#]*" ) ) and
4444 // ... that does not start with a fixed host or a relative path (common formats)
4545 not url .regexpMatch ( "(?i)((https?:)?//)?[-a-z0-9.]*/.*" ) and
46- // .. that is not a call to `url_for` in a Flask application
47- not url .regexpMatch ( "\\{\\{\\s*url_for .*" )
46+ // .. that is not a call to `url_for` in a Flask / nunjucks application
47+ not url .regexpMatch ( "\\{\\{\\s*url(_for)?\\(.+\\) .*" )
4848 )
4949 )
5050}
Original file line number Diff line number Diff line change @@ -62,4 +62,7 @@ function f() {
6262// OK, Flask application with internal links
6363< a href = "{{url_for('foo.html', 'foo')}}" target = "_blank" > Example</ a > ;
6464< a href = "{{ url_for('foo.html', 'foo')}}" target = "_blank" > Example</ a > ;
65- < a href = "{{ url_for('foo.html', 'foo')}}" target = "_blank" > Example</ a > ;
65+ < a href = "{{ url_for('foo.html', 'foo')}}" target = "_blank" > Example</ a > ;
66+
67+ // OK, nunjucks template
68+ < a href = "{{ url('foo', query={bla}) }}" target = "_blank" > Example</ a >
You can’t perform that action at this time.
0 commit comments