Compare commits
1 commit
Author | SHA1 | Date | |
---|---|---|---|
e7aeb1b8a3 |
4 changed files with 24 additions and 3 deletions
|
@ -1,5 +1,6 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="GradleMigrationSettings" migrationVersion="1" />
|
||||
<component name="GradleSettings">
|
||||
<option name="linkedExternalProjectsSettings">
|
||||
<GradleProjectSettings>
|
||||
|
|
|
@ -1,6 +1,9 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="ExternalStorageConfigurationManager" enabled="true" />
|
||||
<component name="FrameworkDetectionExcludesConfiguration">
|
||||
<file type="web" url="file://$PROJECT_DIR$" />
|
||||
</component>
|
||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_17" default="true" project-jdk-name="17" project-jdk-type="JavaSDK">
|
||||
<output url="file://$PROJECT_DIR$/out" />
|
||||
</component>
|
||||
|
|
|
@ -13,6 +13,7 @@ repositories {
|
|||
}
|
||||
|
||||
dependencies {
|
||||
implementation("org.jetbrains:markdown:0.4.1")
|
||||
testImplementation(kotlin("test"))
|
||||
}
|
||||
|
||||
|
|
|
@ -1,9 +1,25 @@
|
|||
package gay.kemonomimi
|
||||
import java.io.*
|
||||
import org.intellij.markdown.parser.MarkdownParser
|
||||
import org.intellij.markdown.flavours.gfm.GFMFlavourDescriptor
|
||||
import org.intellij.markdown.html.HtmlGenerator
|
||||
|
||||
object Main {
|
||||
@JvmStatic
|
||||
fun main(args: Array<String>) {
|
||||
println("Hello World!")
|
||||
println("Program arguments: ${args.joinToString()}")
|
||||
JvavTest().test()
|
||||
val src = "~~Some~~ [example webpage](https://www.example.com)"
|
||||
val flavour = GFMFlavourDescriptor()
|
||||
val parsedTree = MarkdownParser(flavour).buildMarkdownTreeFromString(src)
|
||||
val html = HtmlGenerator(src, parsedTree, flavour).generateHtml()
|
||||
println("Original Text: $src")
|
||||
println("HTML Output: $html")
|
||||
write(html)
|
||||
}
|
||||
|
||||
private fun write(input: String) {
|
||||
val writer = PrintWriter("test.html")
|
||||
writer.append("<style>.user-del { text-decoration: line-through; }</style>\n")
|
||||
writer.append(input + "\n")
|
||||
writer.close()
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue