From a816e917995858129ad074409f73e99d3b100318 Mon Sep 17 00:00:00 2001 From: Vadim Mishenev Date: Mon, 26 Sep 2022 16:33:24 +0300 Subject: Trim four spaces inside indented code block (#2661) * Trim four spaces inside indented code block * Fix test --- plugins/base/src/main/kotlin/parsers/MarkdownParser.kt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'plugins/base/src/main/kotlin/parsers') diff --git a/plugins/base/src/main/kotlin/parsers/MarkdownParser.kt b/plugins/base/src/main/kotlin/parsers/MarkdownParser.kt index 2e301f1e..a1648b16 100644 --- a/plugins/base/src/main/kotlin/parsers/MarkdownParser.kt +++ b/plugins/base/src/main/kotlin/parsers/MarkdownParser.kt @@ -10,6 +10,7 @@ import org.intellij.markdown.ast.impl.ListItemCompositeNode import org.intellij.markdown.flavours.gfm.GFMElementTypes import org.intellij.markdown.flavours.gfm.GFMFlavourDescriptor import org.intellij.markdown.flavours.gfm.GFMTokenTypes +import org.intellij.markdown.html.HtmlGenerator import org.jetbrains.dokka.base.parsers.factories.DocTagsFromIElementFactory import org.jetbrains.dokka.links.DRI import org.jetbrains.dokka.links.PointingToDeclaration @@ -343,7 +344,7 @@ open class MarkdownParser( DocTagsFromIElementFactory.getInstance(node.type, children = node.children.mergeLeafASTNodes().flatMap { DocTagsFromIElementFactory.getInstance( MarkdownTokenTypes.TEXT, - body = text.substring(it.startOffset, it.endOffset) + body = HtmlGenerator.trimIndents(text.substring(it.startOffset, it.endOffset), 4).toString() ) }) -- cgit