md2man.go 541 B

12345678910111213141516171819
  1. package md2man
  2. import (
  3. "github.com/russross/blackfriday"
  4. )
  5. func Render(doc []byte) []byte {
  6. renderer := RoffRenderer(0)
  7. extensions := 0
  8. extensions |= blackfriday.EXTENSION_NO_INTRA_EMPHASIS
  9. extensions |= blackfriday.EXTENSION_TABLES
  10. extensions |= blackfriday.EXTENSION_FENCED_CODE
  11. extensions |= blackfriday.EXTENSION_AUTOLINK
  12. extensions |= blackfriday.EXTENSION_SPACE_HEADERS
  13. extensions |= blackfriday.EXTENSION_FOOTNOTES
  14. extensions |= blackfriday.EXTENSION_TITLEBLOCK
  15. return blackfriday.Markdown(doc, renderer, extensions)
  16. }