mirror of
https://github.com/kovetskiy/mark.git
synced 2026-03-14 14:17:37 +08:00
fix: trim whitespace when parsing 'content-appearance' flag
This commit is contained in:
parent
dcd28068f3
commit
875723da90
@ -4,6 +4,7 @@ import (
|
|||||||
"context"
|
"context"
|
||||||
"errors"
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"strings"
|
||||||
|
|
||||||
altsrc "github.com/urfave/cli-altsrc/v3"
|
altsrc "github.com/urfave/cli-altsrc/v3"
|
||||||
altsrctoml "github.com/urfave/cli-altsrc/v3/toml"
|
altsrctoml "github.com/urfave/cli-altsrc/v3/toml"
|
||||||
@ -220,7 +221,7 @@ func CheckFlags(context context.Context, command *cli.Command) (context.Context,
|
|||||||
return context, errors.New("flags --title-from-h1 and --title-from-filename are mutually exclusive. Please specify only one")
|
return context, errors.New("flags --title-from-h1 and --title-from-filename are mutually exclusive. Please specify only one")
|
||||||
}
|
}
|
||||||
|
|
||||||
contentAppearance := command.String("content-appearance")
|
contentAppearance := strings.TrimSpace(command.String("content-appearance"))
|
||||||
if contentAppearance != "" {
|
if contentAppearance != "" {
|
||||||
switch contentAppearance {
|
switch contentAppearance {
|
||||||
case "full-width", "fixed":
|
case "full-width", "fixed":
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user