-u to render potentially unsafe HTML as written
-w to hard wrap, rendering newlines as <br>
-x to render as XHTML
-h to show help
---
main.go | 67 ++++++++++++++++++++++++++++++++++++++++++++------mdtohtml.1.scd | 17 +++++++++++++
2 files changed, 76 insertions(+), 8 deletions(-)
diff --git a/main.go b/main.go
index e53f89f..8911014 100644
--- a/main.go+++ b/main.go
@@ -1,6 +1,7 @@
package main
import (
+ "flag" "fmt"
"io"
"os"
@@ -9,28 +10,78 @@ import (
"github.com/yuin/goldmark"
highlighting "github.com/yuin/goldmark-highlighting"
"github.com/yuin/goldmark/extension"
+ "github.com/yuin/goldmark/renderer"+ "github.com/yuin/goldmark/renderer/html")
func main() {
- if err := run(); err != nil {+ flag.Usage = func() {+ fmt.Fprintf(os.Stderr,+ `Usage:+ mdtohtml [OPTIONS]++Options:+ -u, --unsafe Render raw HTML as written+ -w, --wrap Render newlines as <br>+ -x, --xhtml Render as XHTML+ -h, --help Show this help message+`)+ }++ var unsafe bool+ flag.BoolVar(&unsafe, "u", false, "Render raw HTML as written")+ var unsafe_long bool+ flag.BoolVar(&unsafe_long, "unsafe", false, "Render raw HTML as written")