Skip to content

Commit

Permalink
fix: build
Browse files Browse the repository at this point in the history
Signed-off-by: Carlos Alexandro Becker <[email protected]>
  • Loading branch information
caarlos0 committed Jul 18, 2024
1 parent a4e220d commit ac108c8
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 8 deletions.
7 changes: 5 additions & 2 deletions ansi/elements.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,11 @@ func (tr *ANSIRenderer) NewElement(node ast.Node, source []byte) Element {

// Paragraph
case ast.KindParagraph:
if node.Parent() != nil && node.Parent().Kind() == ast.KindListItem {
return Element{}
if node.Parent() != nil {
kind := node.Parent().Kind()
if kind == ast.KindListItem {
return Element{}
}
}
return Element{
Renderer: &ParagraphElement{
Expand Down
15 changes: 9 additions & 6 deletions examples/helloworld/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,18 @@ package main
import (
"fmt"

_ "embed"

"github.com/charmbracelet/glamour"
)

//go:embed input.md
var input []byte

func main() {
out, _ := glamour.Render(string(input), "dark")
in := `# Hello World
This is a simple example of Markdown rendering with Glamour!
Check out the [other examples](https://github.com/charmbracelet/glamour/tree/master/examples) too.
Bye!
`

out, _ := glamour.Render(in, "dark")
fmt.Print(out)
}

0 comments on commit ac108c8

Please sign in to comment.