Skip to content
This repository has been archived by the owner on Jul 16, 2023. It is now read-only.

Addresses issue #8 #14

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions prism4j/build.gradle
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
apply plugin: 'java-library'
apply plugin: 'maven-publish'

version = VERSION_NAME

Expand All @@ -20,3 +21,15 @@ if (project.hasProperty('release')) {
}
apply from: 'https://raw.githubusercontent.com/noties/gradle-mvn-push/master/gradle-mvn-push-jar.gradle'
}

publishing {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doesn't seem applicable to the bug fix.

publications {
maven(MavenPublication) {
def libraryFile = file("build/libs/prism4j-${version}.jar")
groupId "io.noties"
artifactId 'prism4j'
version version
artifact libraryFile
}
}
}
4 changes: 3 additions & 1 deletion prism4j/src/main/java/io/noties/prism4j/Prism4j.java
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,9 @@ public Prism4j(@NotNull GrammarLocator grammarLocator) {
public List<Node> tokenize(@NotNull String text, @NotNull Grammar grammar) {
final List<Node> entries = new ArrayList<>(3);
entries.add(new TextImpl(text));
matchGrammar(text, entries, grammar, 0, 0, false, null);
if (text.length() > 0) {
matchGrammar(text, entries, grammar, 0, 0, false, null);
}
return entries;
}

Expand Down