File tree 5 files changed +10
-5
lines changed
5 files changed +10
-5
lines changed Original file line number Diff line number Diff line change 1
1
name : crystagiri
2
- version : 0.3.0
2
+ version : 0.3.1
3
3
4
4
authors :
5
5
Original file line number Diff line number Diff line change @@ -102,4 +102,9 @@ describe Crystagiri::HTML do
102
102
Crystagiri ::HTML .css_query_to_xpath(css_query).should eq xpath_query
103
103
doc.at_css(css_query).should be_a Crystagiri ::Tag
104
104
end
105
+
106
+ it " should find a class with number" do
107
+ doc = Crystagiri ::HTML .from_file " spec/fixture/HTML.html"
108
+ doc.at_css(" .title69" ).should be_a Crystagiri ::Tag
109
+ end
105
110
end
Original file line number Diff line number Diff line change 1
1
<!DOCTYPE html>
2
2
< html >
3
- < head >
3
+ < head class =" title69 " >
4
4
< title > Crystagiri</ title >
5
5
</ head >
6
6
< body >
Original file line number Diff line number Diff line change @@ -31,9 +31,9 @@ module Crystagiri
31
31
def self.css_query_to_xpath (query : String ) : String
32
32
query = " //#{ query } "
33
33
# Convert '#id_name' as '[@id="id_name"]'
34
- query = query.gsub / \# [A-z ]+-*_*[A-z ]+/ { |m| "*[@id=\"%s\"]" % m.delete('#') }
34
+ query = query.gsub / \# [A-z0-9 ]+-*_*[A-z0-9 ]+/ { |m| "*[@id=\"%s\"]" % m.delete('#') }
35
35
# Convert '.classname' as '[@class="classname"]'
36
- query = query.gsub / \.[A - z ]+-* _* [A - z ]+/ { |m | " [@class=\" %s\" ]" % m.delete('.' ) }
36
+ query = query.gsub / \.[A - z0 - 9 ]+-* _* [A - z0 - 9 ]+/ { |m | " [@class=\" %s\" ]" % m.delete('.' ) }
37
37
# Convert ' > ' as '/'
38
38
query = query.gsub / \s* > \s*/ { |m | " /" }
39
39
# Convert ' ' as '//'
Original file line number Diff line number Diff line change 1
1
module Crystagiri
2
- VERSION = " 0.3.0 "
2
+ VERSION = " 0.3.1 "
3
3
end
You can’t perform that action at this time.
0 commit comments