Skip to content

Commit

Permalink
Fix casing issues with the element.before/after tags
Browse files Browse the repository at this point in the history
The code is toLower'd, but the if statements weren't! My bad.
  • Loading branch information
mcmonkey4eva committed Oct 6, 2014
1 parent 4dc3e3d commit 642e76d
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/main/java/net/aufdemrand/denizen/objects/Element.java
Expand Up @@ -1004,7 +1004,7 @@ else if (element.toLowerCase().contains(contains.toLowerCase()))
if (attribute.startsWith("after_last")
&& attribute.hasContext(1)) {
String delimiter = attribute.getContext(1);
if (element.contains(delimiter))
if (element.toLowerCase().contains(delimiter.toLowerCase()))
return new Element(element.substring
(element.toLowerCase().lastIndexOf(delimiter.toLowerCase()) + delimiter.length()))
.getAttribute(attribute.fulfill(1));
Expand All @@ -1024,7 +1024,7 @@ else if (element.toLowerCase().contains(contains.toLowerCase()))
if (attribute.startsWith("after")
&& attribute.hasContext(1)) {
String delimiter = attribute.getContext(1);
if (element.contains(delimiter))
if (element.toLowerCase().contains(delimiter.toLowerCase()))
return new Element(element.substring
(element.toLowerCase().indexOf(delimiter.toLowerCase()) + delimiter.length()))
.getAttribute(attribute.fulfill(1));
Expand All @@ -1044,7 +1044,7 @@ else if (element.toLowerCase().contains(contains.toLowerCase()))
if (attribute.startsWith("before_last")
&& attribute.hasContext(1)) {
String delimiter = attribute.getContext(1);
if (element.contains(delimiter))
if (element.toLowerCase().contains(delimiter.toLowerCase()))
return new Element(element.substring
(0, element.toLowerCase().lastIndexOf(delimiter.toLowerCase())))
.getAttribute(attribute.fulfill(1));
Expand All @@ -1064,7 +1064,7 @@ else if (element.toLowerCase().contains(contains.toLowerCase()))
if (attribute.startsWith("before")
&& attribute.hasContext(1)) {
String delimiter = attribute.getContext(1);
if (element.contains(delimiter))
if (element.toLowerCase().contains(delimiter.toLowerCase()))
return new Element(element.substring
(0, element.toLowerCase().indexOf(delimiter.toLowerCase())))
.getAttribute(attribute.fulfill(1));
Expand Down

0 comments on commit 642e76d

Please sign in to comment.