From 3df1cccc96211384a767b88a70cfa21cdca3ac9f Mon Sep 17 00:00:00 2001 From: Oleg Baskakov Date: Sat, 23 Mar 2024 00:09:49 -0700 Subject: [PATCH] Remove inlineMarkdown representation ...to speed up parsing speed and GC load. Standalone renderer works, but no markdown tests. --- .../kotlin/org/jetbrains/jewel/markdown/MarkdownBlock.kt | 4 ++-- .../jetbrains/jewel/markdown/processing/MarkdownProcessor.kt | 5 ++--- .../markdown/rendering/DefaultInlineMarkdownRenderer.kt | 5 +---- 3 files changed, 5 insertions(+), 9 deletions(-) diff --git a/markdown/core/src/main/kotlin/org/jetbrains/jewel/markdown/MarkdownBlock.kt b/markdown/core/src/main/kotlin/org/jetbrains/jewel/markdown/MarkdownBlock.kt index 5c6a9026d..e0fe96cc9 100644 --- a/markdown/core/src/main/kotlin/org/jetbrains/jewel/markdown/MarkdownBlock.kt +++ b/markdown/core/src/main/kotlin/org/jetbrains/jewel/markdown/MarkdownBlock.kt @@ -1,6 +1,6 @@ package org.jetbrains.jewel.markdown -import org.intellij.lang.annotations.Language +import org.commonmark.node.Node public sealed interface MarkdownBlock { @@ -80,4 +80,4 @@ public interface BlockWithInlineMarkdown { * [block-level elements][MarkdownBlock]. */ @JvmInline -public value class InlineMarkdown(@Language("Markdown") public val content: String) +public value class InlineMarkdown(public val content: Node) diff --git a/markdown/core/src/main/kotlin/org/jetbrains/jewel/markdown/processing/MarkdownProcessor.kt b/markdown/core/src/main/kotlin/org/jetbrains/jewel/markdown/processing/MarkdownProcessor.kt index 5090de9c2..8c335e3ac 100644 --- a/markdown/core/src/main/kotlin/org/jetbrains/jewel/markdown/processing/MarkdownProcessor.kt +++ b/markdown/core/src/main/kotlin/org/jetbrains/jewel/markdown/processing/MarkdownProcessor.kt @@ -189,8 +189,7 @@ public class MarkdownProcessor(private val extensions: List