Skip to content

Commit

Permalink
fix(clidoc): escape html chars
Browse files Browse the repository at this point in the history
  • Loading branch information
aeneasr committed Mar 25, 2021
1 parent da9dff8 commit 1c8059b
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions clidoc/generate.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
package clidoc

import (
"bytes"
"errors"
"fmt"
"html"
"io"
"io/ioutil"
"os"
Expand Down Expand Up @@ -111,9 +113,12 @@ To improve this file please make your change against the appropriate "./cmd/*.go
}

*navItems = append(*navItems, path.Join("cli", basename))
if err := doc.GenMarkdownCustom(cmd, f, trimExt); err != nil {

var b bytes.Buffer
if err := doc.GenMarkdownCustom(cmd, &b, trimExt); err != nil {
return err
}

return nil
_, err = f.WriteString(html.EscapeString(b.String()))
return err
}

0 comments on commit 1c8059b

Please sign in to comment.