Skip to content

Commit

Permalink
Allow underscores in class and id specifiers. Bump version to 0.1.2
Browse files Browse the repository at this point in the history
  • Loading branch information
raymyers committed Jul 24, 2010
1 parent 874f3d6 commit 2979cb8
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 4 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Expand Up @@ -3,7 +3,7 @@ apply plugin: 'eclipse'

archivesBaseName = 'jhaml'
group = 'com.cadrlife.jhaml'
version = '0.1.1'
version = '0.1.2'
sourceCompatibility = 1.5

repositories {
Expand Down
4 changes: 2 additions & 2 deletions dist/ivy-0.1.1.xml → dist/ivy-0.1.2.xml
Expand Up @@ -2,9 +2,9 @@
<ivy-module version="1.0" xmlns:m="http://ant.apache.org/ivy/maven">
<info organisation="com.cadrlife.jhaml"
module="JHaml"
revision="0.1.1"
revision="0.1.2"
status="integration"
publication="20100724140039"
publication="20100724155704"
/>
<configurations>
<conf name="archives" visibility="public" description="Configuration for the default artifacts."/>
Expand Down
Binary file removed dist/jhaml-0.1.1.jar
Binary file not shown.
Binary file added dist/jhaml-0.1.2.jar
Binary file not shown.
Expand Up @@ -30,7 +30,7 @@ public class CharMatchers {
.or(CharMatcher.inRange('\u0300','\u036f'))
.or(CharMatcher.inRange('\u203f','\u2040'));

public static final CharMatcher CLASS_CHAR = CharMatcher.JAVA_LETTER_OR_DIGIT.or(CharMatcher.anyOf(":-"));
public static final CharMatcher CLASS_CHAR = CharMatcher.JAVA_LETTER_OR_DIGIT.or(CharMatcher.anyOf(":-_"));

public static final CharMatcher INDENTATION_CHAR = CharMatcher.anyOf(" \t");

Expand Down
10 changes: 10 additions & 0 deletions src/test/java/com/cadrlife/jhaml/JHamlTest.java
Expand Up @@ -51,6 +51,16 @@ public void idsWithHyphens() {
assertEquals("<div id='a-b'>ABC</div>", jhaml
.parse("#a-b ABC").trim());
}
@Test
public void classesWithUnderscores() {
assertEquals("<div class='a_b'>ABC</div>", jhaml
.parse(".a_b ABC").trim());
}
@Test
public void idsWithUnderscores() {
assertEquals("<div id='a_b'>ABC</div>", jhaml
.parse("#a_b ABC").trim());
}
public void numbersInElementTypeAndSpecifiers() {
assertEquals("<1 class='2' id='3'>456</1>", jhaml.parse("%1.2#3 456"));
}
Expand Down

0 comments on commit 2979cb8

Please sign in to comment.