From 688d88d72b1e1d2ab9ed774cbf3e215a08ef053e Mon Sep 17 00:00:00 2001 From: Timur Demin Date: Sun, 22 Aug 2021 23:05:49 +0300 Subject: [PATCH] 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. --- render.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/render.go b/render.go index 93c68b7..f9e153c 100644 --- a/render.go +++ b/render.go @@ -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