Files
codeql/javascript/ql/test/query-tests/DOM/TargetBlank/tst.html
Max Schaefer c1690a69e5 JavaScript: Make TargetBlank only highlight the first line of the link.
Otherwise alerts for multi-line `<a>` elements end up looking very red.

I also took the opportunity to improve the tests slightly.
2018-11-20 12:53:27 +00:00

31 lines
1.1 KiB
HTML

<!DOCTYPE html>
<html>
<head>
</head>
<body>
<h1>OK</h1>
<a href="http://example.com" target="_blank" rel="noopener noreferrer">Example</a>
<a href="http://example.com" target="_blank" rel="noreferrer">Example</a>
<a href="http://example.com" target="_blank" rel="noopener">Example</a>
<a data-ng-href="https://example.com" target="_blank" rel="noopener">Example</a>
<h1>OK, because of constant URL</h1>
<a href="http://example.com" target="_blank">Example</a>
<a href="http://example.com" target="_blank" rel="nopoener">Example</a>
<a data-ng-href="https://example.com" target="_blank">Example</a>
<h1>OK, because of constant prefix</h1>
<a href="http://example.com/{{X}}" target="_blank">Example</a>
<a href="http://example.com/{{X}}" target="_blank" rel="nopoener">Example</a>
<a data-ng-href="https://example.com/{{X}}" target="_blank">Example</a>
<h1>NOT OK, because of dynamic URL</h1>
<a href="http://example.com{{X}}" target="_blank">Example</a>
<a href="{{target}}" target="_blank">Example</a>
<a href="{{target}}" target="_blank">
Example
</a>
</body>
</html>