https://github.com/nicksrandall/prosemirror-go
This will export ProseMirror content state to HTML, Plain Text, or Markdown
https://github.com/nicksrandall/prosemirror-go
prosemirror
Last synced: 3 months ago
JSON representation
This will export ProseMirror content state to HTML, Plain Text, or Markdown
- Host: GitHub
- URL: https://github.com/nicksrandall/prosemirror-go
- Owner: nicksrandall
- License: mit
- Created: 2017-05-11T21:42:06.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2017-06-01T17:14:56.000Z (over 8 years ago)
- Last Synced: 2025-04-05T02:22:41.431Z (6 months ago)
- Topics: prosemirror
- Language: Go
- Size: 16.6 KB
- Stars: 18
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# prosemirror-go
[](https://godoc.org/github.com/nicksrandall/prosemirror-go)
[](https://travis-ci.org/nicksrandall/prosemirror-go)This will export ProseMirror content state to HTML, Plain Text, or Markdown
## Usage
```go
func Export(rawContentState []byte) (string, error) {
state := prosemirror.ContentState{}if err := json.Unmarshall(rawContentState, &state); err != nil {
return "", err
}config := prosemirror.NewHTMLConfig() // Export HTML
// config := prosemirror.NewMarkdownConfig() // Export Markdown
// config := prosemirror.NewPlainTextConfig() // Export Plain Texthtml := prosemirror.Render(&state, config)
return html, nil
}```