diff options
Diffstat (limited to 'internal/store/store.go')
| -rw-r--r-- | internal/store/store.go | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/internal/store/store.go b/internal/store/store.go index c8e97ea..30e5af0 100644 --- a/internal/store/store.go +++ b/internal/store/store.go @@ -18,6 +18,22 @@ import ( var ErrNotFound = errors.New("not found") var ErrConflict = errors.New("already exists") +// How a post, page intro or announcement source is read: Markdown (rendered +// and sanitised) or raw HTML (put on the blog as written). +const ( + FormatMarkdown = "markdown" + FormatHTML = "html" +) + +// formatOrMD is what gets stored: an unset Format means Markdown, so callers +// that predate the switch (the seed) keep working and the CHECK never fires. +func formatOrMD(f string) string { + if f == FormatHTML { + return FormatHTML + } + return FormatMarkdown +} + type Store struct { db *pgxpool.Pool // control database cluster *db.Cluster |
