Skip to content

Commit

Permalink
Merge pull request #23 from MohamedRejeb/improvements
Browse files Browse the repository at this point in the history
Update README.md
  • Loading branch information
MohamedRejeb authored Sep 1, 2023
2 parents 5d88c58 + c8bf148 commit 214e287
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 8 deletions.
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,14 @@ Ksoup is a lightweight Kotlin Multiplatform library for parsing HTML, extracting
Add the dependency below to your **module**'s `build.gradle.kts` or `build.gradle` file:


| Kotlin version | Ksoup version |
|-----------------|---------------|
| 1.9.0 | 0.2.0 |
| 1.8.22 or lower | 0.1.4 |
| Kotlin version | Ksoup version |
|----------------|---------------|
| 1.9.x | 0.2.1 |
| 1.8.x | 0.1.4 |


```kotlin
val version = "0.2.0"
val version = "0.2.1"

// For parsing HTML
implementation("com.mohamedrejeb.ksoup:ksoup-html:$version")
Expand Down
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ allprojects {
}

group = "com.mohamedrejeb.ksoup"
version = "0.2.0"
version = "0.2.1"

apply(plugin = "maven-publish")
apply(plugin = "signing")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -318,6 +318,31 @@ class KsoupEntitesTest {
assertEquals(expected = """🌍""", actual = KsoupEntities.decodeHtml("🌍"))
}

@Test
fun mountainEmoji() {
assertEquals(expected = """🗻""", actual = KsoupEntities.decodeHtml("🗻"))
}

@Test
fun statusEmoji() {
assertEquals(expected = """🗿""", actual = KsoupEntities.decodeHtml("🗿"))
}

@Test
fun smileEmoji() {
assertEquals(expected = """😀""", actual = KsoupEntities.decodeHtml("😀"))
}

@Test
fun happyEmoji() {
assertEquals(expected = """😁""", actual = KsoupEntities.decodeHtml("😁"))
}

@Test
fun laughEmoji() {
assertEquals(expected = """😂""", actual = KsoupEntities.decodeHtml("😂"))
}

// Encode Test

@Test
Expand Down
5 changes: 4 additions & 1 deletion ksoup-html/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ kotlin {
watchosArm64()
watchosSimulatorArm64()
linuxX64()
linuxArm64()
macosX64()
macosArm64()
mingwX64()
Expand Down Expand Up @@ -53,7 +54,8 @@ kotlin {
val watchosArm64Main by getting
val watchosSimulatorArm64Main by getting
val linuxX64Main by getting
val macosX64Main by getting
val linuxArm64Main by getting
val macosX64Main by getting
val macosArm64Main by getting
val mingwX64Main by getting

Expand All @@ -75,6 +77,7 @@ kotlin {
watchosSimulatorArm64Main.dependsOn(watchosMain)
linuxMain.dependsOn(nativeMain)
linuxX64Main.dependsOn(linuxMain)
linuxArm64Main.dependsOn(linuxMain)
macosMain.dependsOn(nativeMain)
macosX64Main.dependsOn(macosMain)
macosArm64Main.dependsOn(macosMain)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ public class KsoupHtmlParser(
this.endOpenTag(isOpenImplied)

// Self-closing tags will be on the top of the stack
if (this.stack.getOrNull(this.stack.size - 1) == name) {
if (this.stack.size > 0 && this.stack[this.stack.size - 1] == name) {
// If the opening tag isn't implied, the closing tag has to be implied.
this.handler.onCloseTag(name, !isOpenImplied)
this.stack.removeLast()
Expand Down

0 comments on commit 214e287

Please sign in to comment.