diff --git a/ansi/elements.go b/ansi/elements.go index 8a250d5a..83d2a812 100644 --- a/ansi/elements.go +++ b/ansi/elements.go @@ -375,13 +375,13 @@ func (tr *ANSIRenderer) NewElement(node ast.Node, source []byte) Element { Newline: true, } return Element{ - Entering: "\n", Renderer: e, Finisher: e, } case astext.KindDefinitionTerm: return Element{ + Entering: "\n", Renderer: &BaseElement{ Style: ctx.options.Styles.DefinitionTerm, }, @@ -389,6 +389,7 @@ func (tr *ANSIRenderer) NewElement(node ast.Node, source []byte) Element { case astext.KindDefinitionDescription: return Element{ + Exiting: "\n", Renderer: &BaseElement{ Style: ctx.options.Styles.DefinitionDescription, }, diff --git a/ansi/testdata/TestRendererIssues/239.golden b/ansi/testdata/TestRendererIssues/239.golden new file mode 100644 index 00000000..0d88ee10 --- /dev/null +++ b/ansi/testdata/TestRendererIssues/239.golden @@ -0,0 +1,9 @@ + +                                                                              + First term                                                                   + 🠶 Definition one of first term.                                              +                                                                              + Second term                                                                  + 🠶 Definition one of second term.                                             +                                                                              + diff --git a/testdata/issues/239.md b/testdata/issues/239.md new file mode 100644 index 00000000..7b37c37e --- /dev/null +++ b/testdata/issues/239.md @@ -0,0 +1,5 @@ +First term +: Definition one of first term. + +Second term +: Definition one of second term.