Skip to content

Commit

Permalink
better selector examples
Browse files Browse the repository at this point in the history
  • Loading branch information
kraih committed Jan 10, 2015
1 parent 1a2c5de commit 3b30391
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 16 deletions.
6 changes: 3 additions & 3 deletions Changes
Expand Up @@ -566,7 +566,7 @@
- Deprecated Mojo::Util::get_line.
- Fixed ";" handling in Mojo::Parameters to be compliant with the HTML
Living Standard.
- Fixed case sensitivity bug in Mojolicious::Types.
- Fixed case-sensitivity bug in Mojolicious::Types.

4.77 2014-02-06
- Deprecated Mojo::DOM::text_after and Mojo::DOM::text_before in favor of
Expand Down Expand Up @@ -1328,7 +1328,7 @@
- Added charset attribute to Mojo::Path.
- Improved support for relative redirects in Mojo::UserAgent::Transactor.
- Fixed clone bugs in Mojo::Parameters and Mojo::URL.
- Fixed case sensitivity bugs in Mojo::UserAgent::Transactor.
- Fixed case-sensitivity bugs in Mojo::UserAgent::Transactor.

3.60 2012-11-22
- Added unexpected event to Mojo::Transaction::HTTP.
Expand Down Expand Up @@ -2866,7 +2866,7 @@
1.31 2011-05-08
- Reverted deprecation of Perl 5.8.x support, by popular demand.
- Added FAQ entry to clarify the Perl 5.8.x situation.
- Fixed case sensitivity of Mojo::DOM in XML mode.
- Fixed case-sensitivity of Mojo::DOM in XML mode.
- Fixed pseudo class case handling in Mojo::DOM. (Akron)

1.3 2011-05-05
Expand Down
4 changes: 2 additions & 2 deletions lib/Mojo/Collection.pm
Expand Up @@ -337,8 +337,8 @@ Number of elements in collection.
Sort elements based on return value of callback and create a new collection
from the results.
# Sort values case insensitive
my $insensitive = $collection->sort(sub { uc($a) cmp uc($b) });
# Sort values case-insensitive
my $case_insensitive = $collection->sort(sub { uc($a) cmp uc($b) });
=head2 tap
Expand Down
6 changes: 3 additions & 3 deletions lib/Mojo/DOM.pm
Expand Up @@ -451,7 +451,7 @@ L<Mojo::DOM> is a minimalistic and relaxed HTML/XML DOM parser with CSS
selector support. It will even try to interpret broken HTML and XML, so you
should not use it for validation.
=head1 CASE SENSITIVITY
=head1 CASE-SENSITIVITY
L<Mojo::DOM> defaults to HTML semantics, that means all tags and attribute
names are lowercased and selectors need to be lowercase as well.
Expand All @@ -460,7 +460,7 @@ names are lowercased and selectors need to be lowercase as well.
say $dom->at('p')->text;
If XML processing instructions are found, the parser will automatically switch
into XML mode and everything becomes case sensitive.
into XML mode and everything becomes case-sensitive.
my $dom = Mojo::DOM->new('<?xml version="1.0"?><P ID="greeting">Hi!</P>');
say $dom->at('P')->text;
Expand Down Expand Up @@ -950,7 +950,7 @@ children of the first innermost element.
my $bool = $dom->xml;
$dom = $dom->xml($bool);
Disable HTML semantics in parser and activate case sensitivity, defaults to
Disable HTML semantics in parser and activate case-sensitivity, defaults to
auto detection based on processing instructions.
=head1 OPERATORS
Expand Down
12 changes: 6 additions & 6 deletions lib/Mojo/DOM/CSS.pm
Expand Up @@ -347,15 +347,15 @@ An C<E> element with a C<foo> attribute.
An C<E> element whose C<foo> attribute value is exactly equal to C<bar>.
my $fields = $css->select('input[name="foo"]');
my $case_sensitive = $css->select('input[type="hidden"]');
=head2 E[foo="bar" i]
An C<E> element whose C<foo> attribute value is exactly equal to any
(ASCII-range) case-permutation of C<bar>. Note that this selector is
EXPERIMENTAL and might change without warning!
my $fields = $css->select('input[type="hidden" i]');
my $case_insensitive = $css->select('input[type="hidden" i]');
This selector is part of
L<Selectors Level 4|http://dev.w3.org/csswg/selectors-4>, which is still a
Expand All @@ -366,27 +366,27 @@ work in progress.
An C<E> element whose C<foo> attribute value is a list of
whitespace-separated values, one of which is exactly equal to C<bar>.
my $fields = $css->select('input[name~="foo"]');
my $foo = $css->select('input[class~="foo"]');
=head2 E[foo^="bar"]
An C<E> element whose C<foo> attribute value begins exactly with the string
C<bar>.
my $fields = $css->select('input[name^="f"]');
my $begins_with = $css->select('input[name^="f"]');
=head2 E[foo$="bar"]
An C<E> element whose C<foo> attribute value ends exactly with the string
C<bar>.
my $fields = $css->select('input[name$="o"]');
my $ends_with = $css->select('input[name$="o"]');
=head2 E[foo*="bar"]
An C<E> element whose C<foo> attribute value contains the substring C<bar>.
my $fields = $css->select('input[name*="fo"]');
my $contains = $css->select('input[name*="fo"]');
=head2 E:root
Expand Down
2 changes: 1 addition & 1 deletion lib/Mojo/DOM/HTML.pm
Expand Up @@ -322,7 +322,7 @@ carefully since it is very dynamic.
my $bool = $html->xml;
$html = $html->xml($bool);
Disable HTML semantics in parser and activate case sensitivity, defaults to
Disable HTML semantics in parser and activate case-sensitivity, defaults to
auto detection based on processing instructions.
=head1 METHODS
Expand Down
2 changes: 1 addition & 1 deletion lib/Mojolicious/Guides/Routing.pod
Expand Up @@ -298,7 +298,7 @@ L<Mojo::Util/"camelize"> and appended to one or more namespaces, defaulting to
a controller namespace based on the application class (C<MyApp::Controller>),
as well as the bare application class (C<MyApp>), and these namespaces are
searched in that order. The action value is not changed at all, so both values
are case sensitive.
are case-sensitive.

# Application
package MyApp;
Expand Down

0 comments on commit 3b30391

Please sign in to comment.