Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: do not replace comments with empty lines #142

Merged
merged 1 commit into from
Feb 7, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions ansi/elements.go
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ func (tr *ANSIRenderer) NewElement(node ast.Node, source []byte) Element {
return Element{
Exiting: post,
Renderer: &ItemElement{
IsOrdered: node.Parent().(*ast.List).IsOrdered(),
IsOrdered: node.Parent().(*ast.List).IsOrdered(),
Enumeration: e,
},
}
Expand Down Expand Up @@ -332,7 +332,7 @@ func (tr *ANSIRenderer) NewElement(node ast.Node, source []byte) Element {
n := node.(*ast.HTMLBlock)
return Element{
Renderer: &BaseElement{
Token: ctx.SanitizeHTML(string(n.Text(source)), true) + "\n",
Token: ctx.SanitizeHTML(string(n.Text(source)), true),
Style: ctx.options.Styles.HTMLBlock.StylePrimitive,
},
}
Expand Down
11 changes: 11 additions & 0 deletions testdata/readme.markdown.in
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ Check out the [Gold Style Gallery](https://github.com/charmbracelet/gold/blob/ma

Currently `gold` uses the [Aurora ANSI colors](https://godoc.org/github.com/logrusorgru/aurora#Index).

<!-- comments should be ignored -->

## Development

Style definitions located in `styles/` can be embedded into the binary by
Expand All @@ -32,5 +34,14 @@ running [statik](https://github.com/rakyll/statik):
statik -f -src styles -include "*.json"
```

<!--
multiline comments should also be ignored
this is one comment with
more than one
line

yup
-->

You can re-generate screenshots of all available styles by running `gallery.sh`.
This requires `termshot` and `pngcrush` installed on your system!