Skip to content

Commit

Permalink
fix: #239
Browse files Browse the repository at this point in the history
  • Loading branch information
caarlos0 committed Jul 16, 2024
1 parent 5b1bc2a commit b6567c6
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 1 deletion.
3 changes: 2 additions & 1 deletion ansi/elements.go
Original file line number Diff line number Diff line change
Expand Up @@ -375,20 +375,21 @@ 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,
},
}

case astext.KindDefinitionDescription:
return Element{
Exiting: "\n",
Renderer: &BaseElement{
Style: ctx.options.Styles.DefinitionDescription,
},
Expand Down
9 changes: 9 additions & 0 deletions ansi/testdata/TestRendererIssues/239.golden
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@

                                                                             
 First term                                                                  
 🠶 Definition one of first term.                                             
                                                                             
 Second term                                                                 
 🠶 Definition one of second term.                                            
                                                                             

5 changes: 5 additions & 0 deletions testdata/issues/239.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
First term
: Definition one of first term.

Second term
: Definition one of second term.

0 comments on commit b6567c6

Please sign in to comment.