Skip to content

Instantly share code, notes, and snippets.

@dtoebe
Created January 3, 2017 12:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dtoebe/5e2e11339174a471c8e9727d31f36ae0 to your computer and use it in GitHub Desktop.
Save dtoebe/5e2e11339174a471c8e9727d31f36ae0 to your computer and use it in GitHub Desktop.
WRITE A SIMPLE MARKDOWN EDITOR WITH GO-QML - main.go - 7
//main.go
...
type HTMLText struct { //Already created, just a point of reference
...
}
func (h *HTMLText) CopyToClip(txt string) { //A method of the HTMLText pointer that takes a raw markdown string
formatted := blackfriday.MarkdownCommon([]byte(txt)) //We've seen this before
_ = clipboard.WriteAll(string(formatted)) //Make sure you imported the clipboard lib and we convert the formatted []byte to a string
}
...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment