-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
16 changed files
with
96 additions
and
80 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
32 changes: 32 additions & 0 deletions
32
heylogs-api/src/main/java/internal/heylogs/FlexmarkIO.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
package internal.heylogs; | ||
|
||
import com.vladsch.flexmark.formatter.Formatter; | ||
import com.vladsch.flexmark.parser.Parser; | ||
import com.vladsch.flexmark.util.ast.Document; | ||
import nbbrd.io.text.TextFormatter; | ||
import nbbrd.io.text.TextParser; | ||
|
||
public final class FlexmarkIO { | ||
|
||
private FlexmarkIO() { | ||
throw new UnsupportedOperationException("This is a utility class and cannot be instantiated"); | ||
} | ||
|
||
public static Parser newParser() { | ||
return Parser.builder().build(); | ||
} | ||
|
||
public static TextParser<Document> newTextParser() { | ||
return TextParser.onParsingReader(newParser()::parseReader); | ||
} | ||
|
||
public static Formatter newFormatter() { | ||
Formatter.Builder result = Formatter.builder(); | ||
result.set(Formatter.MAX_TRAILING_BLANK_LINES, 0); | ||
return result.build(); | ||
} | ||
|
||
public static TextFormatter<Document> newTextFormatter() { | ||
return TextFormatter.onFormattingWriter(newFormatter()::render); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.