Make the Go compiler calculate renderer flags

This makes the Go compiler automatically calculate renderer
flags bitmask values by putting 1 << iota as the first meaningful flag.
This has a downside of having the first flag always meaning 2, and not
1, whereas WithMetadata already meaned 1, therefore this is a breaking
change.
This commit is contained in:
Timur Demin 2021-08-22 23:05:49 +03:00
parent c872e012e2
commit 688d88d72b
No known key found for this signature in database
GPG key ID: 9EDF3F9D9286FA20

View file

@ -67,10 +67,10 @@ func (s Settings) Has(setting Settings) bool {
const (
// Defaults simply renders the document.
Defaults Settings = 0b0
Defaults Settings = 0
// WithMetadata indicates that the metadata should be included in
// the text produced by the renderer.
WithMetadata Settings = 0b1
WithMetadata Settings = 1 << iota
)
// RenderMarkdown converts Markdown text to Gemtext using gomarkdown. It