mirror of
https://github.com/charmbracelet/glow.git
synced 2026-08-09 09:49:09 +02:00
fix(lint): fix all linting issues
This commit is contained in:
parent
0a6732f089
commit
41d70ee83b
14 changed files with 94 additions and 87 deletions
|
|
@ -1,3 +1,4 @@
|
|||
// Package utils provides utility functions.
|
||||
package utils
|
||||
|
||||
import (
|
||||
|
|
@ -30,7 +31,7 @@ func detectFrontmatter(c []byte) []int {
|
|||
return []int{-1, -1}
|
||||
}
|
||||
|
||||
// Expands tilde and all environment variables from the given path.
|
||||
// ExpandPath expands tilde and all environment variables from the given path.
|
||||
func ExpandPath(path string) string {
|
||||
s, err := homedir.Expand(path)
|
||||
if err == nil {
|
||||
|
|
@ -68,13 +69,13 @@ func IsMarkdownFile(filename string) bool {
|
|||
return false
|
||||
}
|
||||
|
||||
// GlamourStyle returns a glamour.TermRendererOption based on the given style.
|
||||
func GlamourStyle(style string, isCode bool) glamour.TermRendererOption {
|
||||
if !isCode {
|
||||
if style == styles.AutoStyle {
|
||||
return glamour.WithAutoStyle()
|
||||
} else {
|
||||
return glamour.WithStylePath(style)
|
||||
}
|
||||
return glamour.WithStylePath(style)
|
||||
}
|
||||
|
||||
// If we are rendering a pure code block, we need to modify the style to
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue