Skip to content

Commit

Permalink
released 1.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
cinkhangin committed Oct 6, 2023
1 parent 084f2aa commit aa75a05
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .idea/kotlinc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion glow/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ afterEvaluate {
from(components["release"])
groupId = "com.github.cinkhangin"
artifactId = "glow"
version = "1.0.0b"
version = "1.0.0"
}
}
}
Expand Down
20 changes: 16 additions & 4 deletions glow/src/main/java/com/naulian/glow/Glow.kt
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,10 @@ object Glow {


fun hlJava(input: String, theme: Theme = Theme()): HighLight {
val tokens = JTokens.tokenize(input)
val modified = input.replace("<", "&lt")
.replace(">", "&gt")

val tokens = JTokens.tokenize(modified)

val builder = StringBuilder()
tokens.forEach {
Expand Down Expand Up @@ -99,7 +102,10 @@ object Glow {
}

fun hlJavaScript(input: String, theme: Theme = Theme()): HighLight {
val tokens = JsTokens.tokenize(input)
val modified = input.replace("<", "&lt")
.replace(">", "&gt")

val tokens = JsTokens.tokenize(modified)

val builder = StringBuilder()
tokens.forEach {
Expand Down Expand Up @@ -133,7 +139,10 @@ object Glow {
}

fun hlPython(input: String, theme: Theme = Theme()): HighLight {
val tokens = PTokens.tokenize(input)
val modified = input.replace("<", "&lt")
.replace(">", "&gt")

val tokens = PTokens.tokenize(modified)

val builder = StringBuilder()
tokens.forEach {
Expand Down Expand Up @@ -165,7 +174,10 @@ object Glow {
}

fun hlKotlin(input: String, theme: Theme = Theme()): HighLight {
val tokens = KTokens.tokenize(input)
val modified = input.replace("<", "&lt")
.replace(">", "&gt")

val tokens = KTokens.tokenize(modified)

val builder = StringBuilder()
tokens.forEach {
Expand Down

0 comments on commit aa75a05

Please sign in to comment.