Skip to content

Commit

Permalink
17 Remove support for definition list which is not supported by gfm
Browse files Browse the repository at this point in the history
  • Loading branch information
chrishrb committed Dec 26, 2024
1 parent c9f52ed commit 4320472
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 7 deletions.
5 changes: 1 addition & 4 deletions cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ var rootCmd = &cobra.Command{
Run: func(cmd *cobra.Command, args []string) {
theme, _ := cmd.Flags().GetString("theme")
browser, _ := cmd.Flags().GetBool("browser")
openReadme, _ := cmd.Flags().GetBool("readme")
host, _ := cmd.Flags().GetString("host")
port, _ := cmd.Flags().GetInt("port")
boundingBox, _ := cmd.Flags().GetBool("bounding-box")
Expand All @@ -25,7 +24,6 @@ var rootCmd = &cobra.Command{
OpenBrowser: browser,
Host: host,
Port: port,
OpenReadme: openReadme,
BoundingBox: boundingBox,
}

Expand All @@ -48,8 +46,7 @@ func Execute() {
func init() {
rootCmd.Flags().String("theme", "auto", "Select css theme [light/dark/auto]")
rootCmd.Flags().BoolP("browser", "b", true, "Open new browser tab")
rootCmd.Flags().BoolP("readme", "r", true, "Open readme if no file provided")
rootCmd.Flags().StringP("host", "H", "localhost", "Host to use")
rootCmd.Flags().IntP("port", "p", 6419, "Port to use")
rootCmd.Flags().BoolP("bounding-box", "B", true, "Add bounding box to HTML")
rootCmd.Flags().Bool("bounding-box", true, "Add bounding box to HTML")
}
1 change: 0 additions & 1 deletion pkg/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,5 @@ type Client struct {
OpenBrowser bool
Host string
Port int
OpenReadme bool
BoundingBox bool
}
4 changes: 3 additions & 1 deletion pkg/parser.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@ import (
var blockquotes = []string{"Note", "Tip", "Important", "Warning", "Caution"}

func (client *Client) MdToHTML(bytes []byte) []byte {
extensions := parser.CommonExtensions | parser.AutoHeadingIDs
extensions := parser.NoIntraEmphasis | parser.Tables | parser.FencedCode |
parser.Autolink | parser.Strikethrough | parser.SpaceHeadings | parser.HeadingIDs |
parser.BackslashLineBreak | parser.MathJax
p := parser.NewWithExtensions(extensions)
doc := p.Parse(bytes)

Expand Down
2 changes: 1 addition & 1 deletion pkg/webserver.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ func (client *Client) Serve(file string) error {
if err == nil {
defer f.Close()
}
if err == nil && client.OpenReadme {
if err == nil {
addr, _ = url.JoinPath(addr, readme)
}
} else {
Expand Down

0 comments on commit 4320472

Please sign in to comment.