Created
January 3, 2017 12:02
-
-
Save dtoebe/5e2e11339174a471c8e9727d31f36ae0 to your computer and use it in GitHub Desktop.
WRITE A SIMPLE MARKDOWN EDITOR WITH GO-QML - main.go - 7
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//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