Skip to content

Commit

Permalink
⚽️ Kick-off version 3.0.5
Browse files Browse the repository at this point in the history
  • Loading branch information
jesperancinha committed Nov 2, 2021
1 parent c253692 commit 4609e62
Show file tree
Hide file tree
Showing 8 changed files with 40 additions and 12 deletions.
4 changes: 2 additions & 2 deletions Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ Please Look into the javadocs for more info or check our [reference documentatio

## Release 3.0.4 - 2021/10/31

- Spring Boot upgrade to 2.5.5.
- Emoji handling for badges
- Spring Boot upgrade to 2.5.5.
- Emoji handling for badges

## Release 3.0.3 - 2021/08/26

Expand Down
2 changes: 1 addition & 1 deletion docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ Please Look into the javadocs for more info or check our [reference documentatio
<dependency>
<groupId>org.jesperancinha.parser</groupId>
<artifactId>markdowner</artifactId>
<version>3.0.4</version>
<version>3.0.5</version>
<type>pom</type>
</dependency>
```
Expand Down
4 changes: 2 additions & 2 deletions markdowner-core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<artifactId>markdowner</artifactId>
<groupId>org.jesperancinha.parser</groupId>
<version>3.0.4</version>
<version>3.0.5</version>
</parent>
<artifactId>markdowner-core</artifactId>
<name>Markdowner core</name>
Expand Down Expand Up @@ -34,7 +34,7 @@
<connection>git@github.com:jesperancinha/markdowner.git</connection>
<developerConnection>git@github.com:jesperancinha/markdowner.git</developerConnection>
<url>https://github.com/jesperancinha/markdowner/tree/master/markdowner-core</url>
<tag>3.0.4</tag>
<tag>3.0.5</tag>
</scm>
<distributionManagement>
<snapshotRepository>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public class BadgeParser {
private static final ObjectMapper objectMapper = new ObjectMapper();
private static final String GENERIC_REGEX = "a-zA-Z0-9\\/\\.\\]\\?\\=\\-\\&\\%%\\;\\_\\#\\:\\@\\\"\\ ";
private static final String EMOJI_REGEX =
"\uD83C\uDFE2-\uD83D\uDEE3\u00a9\u00ae\u2000-\u3300\ud83c\ud000-\udfff\ud83d\ud000-\udfff\ud83e\ud000-\udfff\ufe0f";
"\uD83C\uDFE2-\uD83D\uDEE3\u00a9\u00ae\u2000-\u3300\ud83c\ud000-\udfff\ud83d\ud000-\udfff\ud83e\ud000-\udfff\ufe0f\uD83C\uDFB8-\uD83E\uDE99";
public static final String FULL_REGEX = GENERIC_REGEX.concat(EMOJI_REGEX);
private static final String BADGE_REGEX =
"(\\[!\\[%s]\\(http[s]*:\\/\\/%s[" + FULL_REGEX + "]*\\)]\\((http[s]*:\\/\\/)*[" + FULL_REGEX + "]*\\))";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,24 @@ class BadgeParserKtTest {
testString.replace(testRegex,"") .shouldHaveLength(0)
}

@Test
fun `should parse emoji coin cup`() {
val testRegex = Regex("[".plus(BadgeParser.FULL_REGEX).plus("]"))
val testString = "coin 🪙 coin"

testString.shouldHaveLength(12)
testString.replace(testRegex,"") .shouldHaveLength(0)
}

@Test
fun `should parse emoji guitar cup`() {
val testRegex = Regex("[".plus(BadgeParser.FULL_REGEX).plus("]"))
val testString = "guitar 🎸 guitar"

testString.shouldHaveLength(16)
testString.replace(testRegex,"") .shouldHaveLength(0)
}

@Test
fun `should parse emoji pen`() {
val testRegex = Regex("[".plus(BadgeParser.FULL_REGEX).plus("]"))
Expand Down Expand Up @@ -72,6 +90,16 @@ class BadgeParserKtTest {
.shouldNotBeNull()
}

@Test
fun `should parse emoji generic badges example 6`() {
val testText =
"[![Generic badge](https://img.shields.io/static/v1.svg?label=GitHub&message=Concert%20Demos%20\uD83C\uDFB8%20&color=informational)](https://github.com/jesperancinha/concert-demos-root)"
val parse = BadgeParser.parse(testText)

parse[parse.keys.first()]?.badgeHashMap?.filter { it.key.pattern().contains("Generic badge") }?.values?.first()
.shouldNotBeNull()
}

@Test
fun `should parse normal generic badges example 1`() {
val testText =
Expand Down
2 changes: 1 addition & 1 deletion markdowner-filter/Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
<dependency>
<groupId>org.jesperancinha.parser</groupId>
<artifactId>markdowner-filter</artifactId>
<version>3.0.4</version>
<version>3.0.5</version>
</dependency>
```

Expand Down
4 changes: 2 additions & 2 deletions markdowner-filter/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>markdowner</artifactId>
<groupId>org.jesperancinha.parser</groupId>
<version>3.0.4</version>
<version>3.0.5</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand All @@ -30,7 +30,7 @@
<connection>git@github.com:jesperancinha/markdowner.git</connection>
<developerConnection>git@github.com:jesperancinha/markdowner.git</developerConnection>
<url>https://github.com/jesperancinha/markdowner/tree/master/markdowner-filter</url>
<tag>3.0.4</tag>
<tag>3.0.5</tag>
</scm>
<distributionManagement>
<snapshotRepository>
Expand Down
6 changes: 3 additions & 3 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<groupId>org.jesperancinha.parser</groupId>
<artifactId>markdowner</artifactId>
<name>Markdowner parent POM</name>
<version>3.0.4</version>
<version>3.0.5</version>
<description>Parent pom of the markdowner libraries</description>
<url>https://github.com/jesperancinha/markdowner</url>
<licenses>
Expand All @@ -27,7 +27,7 @@
<connection>scm:git:git://github.com:jesperancinha/markdowner.git</connection>
<developerConnection>scm:git:git://github.com:jesperancinha/markdowner.git</developerConnection>
<url>https://github.com/jesperancinha/markdowner</url>
<tag>3.0.4</tag>
<tag>3.0.5</tag>
</scm>
<distributionManagement>
<snapshotRepository>
Expand Down Expand Up @@ -64,7 +64,7 @@
<commons-io.version>2.11.0</commons-io.version>
<gson.version>2.8.8</gson.version>
<mapstruct-processor.version>1.3.0.Final</mapstruct-processor.version>
<markdowner.version>3.0.4</markdowner.version>
<markdowner.version>3.0.5</markdowner.version>
<jacoco-maven-plugin.version>0.8.7</jacoco-maven-plugin.version>
<coveralls-maven-plugin.version>4.3.0</coveralls-maven-plugin.version>
<jaxb-api.version>2.3.1</jaxb-api.version>
Expand Down

0 comments on commit 4609e62

Please sign in to comment.