-
-
Notifications
You must be signed in to change notification settings - Fork 163
Closed
Description
With @html markup from test/floki_test.exs:
<html>
<head>
<title>Test</title>
</head>
<body>
<div class="content">
<a href="http://google.com" class="js-google js-cool">Google</a>
<a href="http://elixir-lang.org" class="js-elixir js-cool">Elixir lang</a>
<a href="http://java.com" class="js-java">Java</a>
</div>
</body>
</html>
I am trying to search for an element with multiple classes (on the same element) with the selector .js-cool.js-elixir but Floki is not finding them. However, if I add a space between the classes, as if the second was a descendent of the first, .js-cool .js-elixir, it does return what I'm looking for but should not (as js-elixir is not descendent of js-cool).
Test demonstrating the error:
test "find elements with given multiple classes" do
class_selector = ".js-cool.js-elixir"
assert Floki.find(@html, class_selector) == [
{"a", [
{"href", "http://elixir-lang.org"},
{"class", "js-elixir js-cool"}],
["Elixir lang"]}
]
end
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels