Skip to content
Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
add missing :
  • Loading branch information
kjj6198 committed Apr 27, 2020
commit b7b86d46ad6ae6330c3f8691eddd44378a79aa6b
2 changes: 1 addition & 1 deletion src/compiler/compile/nodes/Element.ts
Original file line number Diff line number Diff line change
Expand Up @@ -428,7 +428,7 @@ export default class Element extends Node {
if (attribute) {
const value = attribute.get_static_value();

if (value === '' || value === '#' || /^\W*?javascript/.test(value)) {
if (value === '' || value === '#' || /^\W*javascript:/.test(value)) {
Copy link
Contributor

@bwbroersma bwbroersma Apr 28, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A case insensitive check should be done, since URI schemes are case insensitive RFC 2396:

/^\W*javascript:/i.test(value)

Copy link
Contributor Author

@kjj6198 kjj6198 Apr 28, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks for the information!

component.warn(attribute, {
code: `a11y-invalid-attribute`,
message: `A11y: '${value}' is not a valid ${attribute.name} attribute`
Expand Down