Skip to content

Commit

Permalink
Merge 40bc7cd into 54f71ef
Browse files Browse the repository at this point in the history
  • Loading branch information
ludofischer committed May 7, 2021
2 parents 54f71ef + 40bc7cd commit 63eda5e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
7 changes: 7 additions & 0 deletions src/__tests__/attributes.js
Expand Up @@ -367,6 +367,13 @@ test('extraneous non-combinating whitespace', ' [href] , [class] ', (t, tr
t.deepEqual(tree.nodes[1].nodes[0].spaces.after, ' ');
});

test('newline in attribute selector', '[class="woop \\\nwoop woop"]', (t, tree) => {
t.deepEqual(tree.nodes[0].nodes[0].attribute, 'class');
t.deepEqual(tree.nodes[0].nodes[0].operator, '=');
t.deepEqual(tree.nodes[0].nodes[0].value, 'woop \nwoop woop');
t.true(tree.nodes[0].nodes[0].quoted);
});

test('comments within attribute selectors', '[href/* wow */=/* wow */test]', (t, tree) => {
t.deepEqual(tree.nodes[0].nodes[0].attribute, 'href');
t.deepEqual(tree.nodes[0].nodes[0].operator, '=');
Expand Down
2 changes: 1 addition & 1 deletion src/selectors/attribute.js
Expand Up @@ -5,7 +5,7 @@ import {ATTRIBUTE} from './types';

const deprecate = require("util-deprecate");

const WRAPPED_IN_QUOTES = /^('|")(.*)\1$/;
const WRAPPED_IN_QUOTES = /^('|")([^]*)\1$/;

const warnOfDeprecatedValueAssignment = deprecate(() => {},
"Assigning an attribute a value containing characters that might need to be escaped is deprecated. " +
Expand Down

0 comments on commit 63eda5e

Please sign in to comment.