package web import ( "strconv" "git.zb-server.de/ZB-Server/uptimesebi/internal/i18n" ) // Markdown editor feature sets. Every entry is something RenderMarkdown // shows; images and raw HTML are not, so the editor offers neither. var ( // MarkdownDocument suits standalone pages such as a legal notice. MarkdownDocument = []string{"heading", "bold", "italic", "strike", "link", "ul", "ol", "quote", "code", "codeblock", "table", "hr"} // MarkdownInline suits descriptions shown inside a page, where headings // and tables would compete with the page's own structure. MarkdownInline = []string{"bold", "italic", "strike", "link", "ul", "ol", "quote", "code"} ) var markdownGlyphs = map[string]string{ "heading": "H", "bold": "B", "italic": "I", "strike": "S", "link": "↗", "ul": "•", "ol": "1.", "quote": "❝", "code": "`", "codeblock": "{ }", "table": "▦", "hr": "—", } var markdownGlyphClass = map[string]string{"bold": "font-bold", "italic": "italic", "strike": "line-through"} // MarkdownEditor is a textarea with a toolbar of features, a preview // rendered by the server, list continuation and a character count. templ MarkdownEditor(name, value string, rows, maxLength int, features []string) {