Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add comments about errors #399

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ Convert Markdown documents with the CommonMark-compliant mode:
```go
var buf bytes.Buffer
if err := goldmark.Convert(source, &buf); err != nil {
panic(err)
panic(err) // errors won't occur with in-memory buffer and default html renderers
}
```

Expand Down
2 changes: 2 additions & 0 deletions markdown.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ var defaultMarkdown = New()

// Convert interprets a UTF-8 bytes source in Markdown and
// write rendered contents to a writer w.
// Errors are reported as per the Writer interface and provided renderers.
func Convert(source []byte, w io.Writer, opts ...parser.ParseOption) error {
return defaultMarkdown.Convert(source, w, opts...)
}
Expand All @@ -36,6 +37,7 @@ func Convert(source []byte, w io.Writer, opts ...parser.ParseOption) error {
type Markdown interface {
// Convert interprets a UTF-8 bytes source in Markdown and write rendered
// contents to a writer w.
// Errors are reported as per the Writer interface and provided renderers.
Convert(source []byte, writer io.Writer, opts ...parser.ParseOption) error

// Parser returns a Parser that will be used for conversion.
Expand Down