mirror of
https://github.com/openfaas/faas.git
synced 2025-06-18 03:56:37 +00:00
Include markdown sample
Fix UI refresh problem Enable invocation from portal
This commit is contained in:
17
sample-functions/MarkdownRender/handler.go
Normal file
17
sample-functions/MarkdownRender/handler.go
Normal file
@ -0,0 +1,17 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"io/ioutil"
|
||||
"os"
|
||||
|
||||
"github.com/microcosm-cc/bluemonday"
|
||||
"github.com/russross/blackfriday"
|
||||
)
|
||||
|
||||
func main() {
|
||||
input, _ := ioutil.ReadAll(os.Stdin)
|
||||
unsafe := blackfriday.MarkdownCommon([]byte(input))
|
||||
html := bluemonday.UGCPolicy().SanitizeBytes(unsafe)
|
||||
fmt.Println(string(html))
|
||||
}
|
Reference in New Issue
Block a user