Skip to content

Commit

Permalink
Use AST DSL in Box.error
Browse files Browse the repository at this point in the history
  • Loading branch information
iamgio committed Sep 25, 2024
1 parent 6d6cbc4 commit 375feb0
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import eu.iamgio.quarkdown.ast.InlineContent
import eu.iamgio.quarkdown.ast.NestableNode
import eu.iamgio.quarkdown.ast.Node
import eu.iamgio.quarkdown.ast.base.block.Paragraph
import eu.iamgio.quarkdown.ast.base.inline.Text
import eu.iamgio.quarkdown.ast.dsl.buildInline
import eu.iamgio.quarkdown.document.size.Size
import eu.iamgio.quarkdown.misc.color.Color
import eu.iamgio.quarkdown.rendering.representable.RenderRepresentable
Expand Down Expand Up @@ -69,7 +69,10 @@ data class Box(
message: InlineContent,
title: String? = null,
) = Box(
title = listOf(Text("Error" + if (title != null) ": $title" else "")),
title =
buildInline {
text("Error" + if (title != null) ": $title" else "")
},
type = Type.ERROR,
children = listOf(Paragraph(message)),
)
Expand Down

0 comments on commit 375feb0

Please sign in to comment.