diff --git a/routes.go b/routes.go index 20dfdaa..4524634 100644 --- a/routes.go +++ b/routes.go @@ -4,6 +4,7 @@ import ( "html/template" "io/ioutil" "net/http" + "regexp" "strconv" "strings" @@ -62,9 +63,16 @@ func renderMarkdown(c *gin.Context, title string) { } unsafe := blackfriday.MarkdownCommon([]byte(p.Text)) html := bluemonday.UGCPolicy().SanitizeBytes(unsafe) + html2 := string(html) + + r, _ := regexp.Compile("\\$(.*?)\\$") + for _, s := range r.FindAllString(html2, -1) { + html2 = strings.Replace(html2, s, "
", 1) + } + c.HTML(http.StatusOK, "view.tmpl", gin.H{ "Title": title, - "Body": template.HTML(html), + "Body": template.HTML([]byte(html2)), }) } diff --git a/static/css/fonts/KaTeX_AMS-Regular.eot b/static/css/fonts/KaTeX_AMS-Regular.eot new file mode 100644 index 0000000..784276a Binary files /dev/null and b/static/css/fonts/KaTeX_AMS-Regular.eot differ diff --git a/static/css/fonts/KaTeX_AMS-Regular.ttf b/static/css/fonts/KaTeX_AMS-Regular.ttf new file mode 100644 index 0000000..6f1e0be Binary files /dev/null and b/static/css/fonts/KaTeX_AMS-Regular.ttf differ diff --git a/static/css/fonts/KaTeX_AMS-Regular.woff b/static/css/fonts/KaTeX_AMS-Regular.woff new file mode 100644 index 0000000..4dded47 Binary files /dev/null and b/static/css/fonts/KaTeX_AMS-Regular.woff differ diff --git a/static/css/fonts/KaTeX_AMS-Regular.woff2 b/static/css/fonts/KaTeX_AMS-Regular.woff2 new file mode 100644 index 0000000..ea81079 Binary files /dev/null and b/static/css/fonts/KaTeX_AMS-Regular.woff2 differ diff --git a/static/css/fonts/KaTeX_Caligraphic-Bold.eot b/static/css/fonts/KaTeX_Caligraphic-Bold.eot new file mode 100644 index 0000000..1a0db0c Binary files /dev/null and b/static/css/fonts/KaTeX_Caligraphic-Bold.eot differ diff --git a/static/css/fonts/KaTeX_Caligraphic-Bold.ttf b/static/css/fonts/KaTeX_Caligraphic-Bold.ttf new file mode 100644 index 0000000..b94907d Binary files /dev/null and b/static/css/fonts/KaTeX_Caligraphic-Bold.ttf differ diff --git a/static/css/fonts/KaTeX_Caligraphic-Bold.woff b/static/css/fonts/KaTeX_Caligraphic-Bold.woff new file mode 100644 index 0000000..799fa81 Binary files /dev/null and b/static/css/fonts/KaTeX_Caligraphic-Bold.woff differ diff --git a/static/css/fonts/KaTeX_Caligraphic-Bold.woff2 b/static/css/fonts/KaTeX_Caligraphic-Bold.woff2 new file mode 100644 index 0000000..73bb542 Binary files /dev/null and b/static/css/fonts/KaTeX_Caligraphic-Bold.woff2 differ diff --git a/static/css/fonts/KaTeX_Caligraphic-Regular.eot b/static/css/fonts/KaTeX_Caligraphic-Regular.eot new file mode 100644 index 0000000..6cc83d0 Binary files /dev/null and b/static/css/fonts/KaTeX_Caligraphic-Regular.eot differ diff --git a/static/css/fonts/KaTeX_Caligraphic-Regular.ttf b/static/css/fonts/KaTeX_Caligraphic-Regular.ttf new file mode 100644 index 0000000..cf51e20 Binary files /dev/null and b/static/css/fonts/KaTeX_Caligraphic-Regular.ttf differ diff --git a/static/css/fonts/KaTeX_Caligraphic-Regular.woff b/static/css/fonts/KaTeX_Caligraphic-Regular.woff new file mode 100644 index 0000000..f5e5c62 Binary files /dev/null and b/static/css/fonts/KaTeX_Caligraphic-Regular.woff differ diff --git a/static/css/fonts/KaTeX_Caligraphic-Regular.woff2 b/static/css/fonts/KaTeX_Caligraphic-Regular.woff2 new file mode 100644 index 0000000..dd76d34 Binary files /dev/null and b/static/css/fonts/KaTeX_Caligraphic-Regular.woff2 differ diff --git a/static/css/fonts/KaTeX_Fraktur-Bold.eot b/static/css/fonts/KaTeX_Fraktur-Bold.eot new file mode 100644 index 0000000..1960b10 Binary files /dev/null and b/static/css/fonts/KaTeX_Fraktur-Bold.eot differ diff --git a/static/css/fonts/KaTeX_Fraktur-Bold.ttf b/static/css/fonts/KaTeX_Fraktur-Bold.ttf new file mode 100644 index 0000000..7b0790f Binary files /dev/null and b/static/css/fonts/KaTeX_Fraktur-Bold.ttf differ diff --git a/static/css/fonts/KaTeX_Fraktur-Bold.woff b/static/css/fonts/KaTeX_Fraktur-Bold.woff new file mode 100644 index 0000000..dc32571 Binary files /dev/null and b/static/css/fonts/KaTeX_Fraktur-Bold.woff differ diff --git a/static/css/fonts/KaTeX_Fraktur-Bold.woff2 b/static/css/fonts/KaTeX_Fraktur-Bold.woff2 new file mode 100644 index 0000000..fdc4292 Binary files /dev/null and b/static/css/fonts/KaTeX_Fraktur-Bold.woff2 differ diff --git a/static/css/fonts/KaTeX_Fraktur-Regular.eot b/static/css/fonts/KaTeX_Fraktur-Regular.eot new file mode 100644 index 0000000..e4e7379 Binary files /dev/null and b/static/css/fonts/KaTeX_Fraktur-Regular.eot differ diff --git a/static/css/fonts/KaTeX_Fraktur-Regular.ttf b/static/css/fonts/KaTeX_Fraktur-Regular.ttf new file mode 100644 index 0000000..063bc02 Binary files /dev/null and b/static/css/fonts/KaTeX_Fraktur-Regular.ttf differ diff --git a/static/css/fonts/KaTeX_Fraktur-Regular.woff b/static/css/fonts/KaTeX_Fraktur-Regular.woff new file mode 100644 index 0000000..c4b18d8 Binary files /dev/null and b/static/css/fonts/KaTeX_Fraktur-Regular.woff differ diff --git a/static/css/fonts/KaTeX_Fraktur-Regular.woff2 b/static/css/fonts/KaTeX_Fraktur-Regular.woff2 new file mode 100644 index 0000000..4318d93 Binary files /dev/null and b/static/css/fonts/KaTeX_Fraktur-Regular.woff2 differ diff --git a/static/css/fonts/KaTeX_Main-Bold.eot b/static/css/fonts/KaTeX_Main-Bold.eot new file mode 100644 index 0000000..80fbd02 Binary files /dev/null and b/static/css/fonts/KaTeX_Main-Bold.eot differ diff --git a/static/css/fonts/KaTeX_Main-Bold.ttf b/static/css/fonts/KaTeX_Main-Bold.ttf new file mode 100644 index 0000000..8e10722 Binary files /dev/null and b/static/css/fonts/KaTeX_Main-Bold.ttf differ diff --git a/static/css/fonts/KaTeX_Main-Bold.woff b/static/css/fonts/KaTeX_Main-Bold.woff new file mode 100644 index 0000000..43b361a Binary files /dev/null and b/static/css/fonts/KaTeX_Main-Bold.woff differ diff --git a/static/css/fonts/KaTeX_Main-Bold.woff2 b/static/css/fonts/KaTeX_Main-Bold.woff2 new file mode 100644 index 0000000..af57a96 Binary files /dev/null and b/static/css/fonts/KaTeX_Main-Bold.woff2 differ diff --git a/static/css/fonts/KaTeX_Main-Italic.eot b/static/css/fonts/KaTeX_Main-Italic.eot new file mode 100644 index 0000000..fc77016 Binary files /dev/null and b/static/css/fonts/KaTeX_Main-Italic.eot differ diff --git a/static/css/fonts/KaTeX_Main-Italic.ttf b/static/css/fonts/KaTeX_Main-Italic.ttf new file mode 100644 index 0000000..d124495 Binary files /dev/null and b/static/css/fonts/KaTeX_Main-Italic.ttf differ diff --git a/static/css/fonts/KaTeX_Main-Italic.woff b/static/css/fonts/KaTeX_Main-Italic.woff new file mode 100644 index 0000000..e623236 Binary files /dev/null and b/static/css/fonts/KaTeX_Main-Italic.woff differ diff --git a/static/css/fonts/KaTeX_Main-Italic.woff2 b/static/css/fonts/KaTeX_Main-Italic.woff2 new file mode 100644 index 0000000..944e974 Binary files /dev/null and b/static/css/fonts/KaTeX_Main-Italic.woff2 differ diff --git a/static/css/fonts/KaTeX_Main-Regular.eot b/static/css/fonts/KaTeX_Main-Regular.eot new file mode 100644 index 0000000..dc60c09 Binary files /dev/null and b/static/css/fonts/KaTeX_Main-Regular.eot differ diff --git a/static/css/fonts/KaTeX_Main-Regular.ttf b/static/css/fonts/KaTeX_Main-Regular.ttf new file mode 100644 index 0000000..da5797f Binary files /dev/null and b/static/css/fonts/KaTeX_Main-Regular.ttf differ diff --git a/static/css/fonts/KaTeX_Main-Regular.woff b/static/css/fonts/KaTeX_Main-Regular.woff new file mode 100644 index 0000000..37db672 Binary files /dev/null and b/static/css/fonts/KaTeX_Main-Regular.woff differ diff --git a/static/css/fonts/KaTeX_Main-Regular.woff2 b/static/css/fonts/KaTeX_Main-Regular.woff2 new file mode 100644 index 0000000..4882042 Binary files /dev/null and b/static/css/fonts/KaTeX_Main-Regular.woff2 differ diff --git a/static/css/fonts/KaTeX_Math-BoldItalic.eot b/static/css/fonts/KaTeX_Math-BoldItalic.eot new file mode 100644 index 0000000..52c8b8c Binary files /dev/null and b/static/css/fonts/KaTeX_Math-BoldItalic.eot differ diff --git a/static/css/fonts/KaTeX_Math-BoldItalic.ttf b/static/css/fonts/KaTeX_Math-BoldItalic.ttf new file mode 100644 index 0000000..a8b527c Binary files /dev/null and b/static/css/fonts/KaTeX_Math-BoldItalic.ttf differ diff --git a/static/css/fonts/KaTeX_Math-BoldItalic.woff b/static/css/fonts/KaTeX_Math-BoldItalic.woff new file mode 100644 index 0000000..8940e0b Binary files /dev/null and b/static/css/fonts/KaTeX_Math-BoldItalic.woff differ diff --git a/static/css/fonts/KaTeX_Math-BoldItalic.woff2 b/static/css/fonts/KaTeX_Math-BoldItalic.woff2 new file mode 100644 index 0000000..15cf56d Binary files /dev/null and b/static/css/fonts/KaTeX_Math-BoldItalic.woff2 differ diff --git a/static/css/fonts/KaTeX_Math-Italic.eot b/static/css/fonts/KaTeX_Math-Italic.eot new file mode 100644 index 0000000..64c8992 Binary files /dev/null and b/static/css/fonts/KaTeX_Math-Italic.eot differ diff --git a/static/css/fonts/KaTeX_Math-Italic.ttf b/static/css/fonts/KaTeX_Math-Italic.ttf new file mode 100644 index 0000000..06f39d3 Binary files /dev/null and b/static/css/fonts/KaTeX_Math-Italic.ttf differ diff --git a/static/css/fonts/KaTeX_Math-Italic.woff b/static/css/fonts/KaTeX_Math-Italic.woff new file mode 100644 index 0000000..cf3b4b7 Binary files /dev/null and b/static/css/fonts/KaTeX_Math-Italic.woff differ diff --git a/static/css/fonts/KaTeX_Math-Italic.woff2 b/static/css/fonts/KaTeX_Math-Italic.woff2 new file mode 100644 index 0000000..5f8c4bf Binary files /dev/null and b/static/css/fonts/KaTeX_Math-Italic.woff2 differ diff --git a/static/css/fonts/KaTeX_Math-Regular.eot b/static/css/fonts/KaTeX_Math-Regular.eot new file mode 100644 index 0000000..5521e6a Binary files /dev/null and b/static/css/fonts/KaTeX_Math-Regular.eot differ diff --git a/static/css/fonts/KaTeX_Math-Regular.ttf b/static/css/fonts/KaTeX_Math-Regular.ttf new file mode 100644 index 0000000..7312708 Binary files /dev/null and b/static/css/fonts/KaTeX_Math-Regular.ttf differ diff --git a/static/css/fonts/KaTeX_Math-Regular.woff b/static/css/fonts/KaTeX_Math-Regular.woff new file mode 100644 index 0000000..0e2ebdf Binary files /dev/null and b/static/css/fonts/KaTeX_Math-Regular.woff differ diff --git a/static/css/fonts/KaTeX_Math-Regular.woff2 b/static/css/fonts/KaTeX_Math-Regular.woff2 new file mode 100644 index 0000000..ebe3d02 Binary files /dev/null and b/static/css/fonts/KaTeX_Math-Regular.woff2 differ diff --git a/static/css/fonts/KaTeX_SansSerif-Bold.eot b/static/css/fonts/KaTeX_SansSerif-Bold.eot new file mode 100644 index 0000000..1660e76 Binary files /dev/null and b/static/css/fonts/KaTeX_SansSerif-Bold.eot differ diff --git a/static/css/fonts/KaTeX_SansSerif-Bold.ttf b/static/css/fonts/KaTeX_SansSerif-Bold.ttf new file mode 100644 index 0000000..dbeb7b9 Binary files /dev/null and b/static/css/fonts/KaTeX_SansSerif-Bold.ttf differ diff --git a/static/css/fonts/KaTeX_SansSerif-Bold.woff b/static/css/fonts/KaTeX_SansSerif-Bold.woff new file mode 100644 index 0000000..8f144a8 Binary files /dev/null and b/static/css/fonts/KaTeX_SansSerif-Bold.woff differ diff --git a/static/css/fonts/KaTeX_SansSerif-Bold.woff2 b/static/css/fonts/KaTeX_SansSerif-Bold.woff2 new file mode 100644 index 0000000..329e855 Binary files /dev/null and b/static/css/fonts/KaTeX_SansSerif-Bold.woff2 differ diff --git a/static/css/fonts/KaTeX_SansSerif-Italic.eot b/static/css/fonts/KaTeX_SansSerif-Italic.eot new file mode 100644 index 0000000..289ae3f Binary files /dev/null and b/static/css/fonts/KaTeX_SansSerif-Italic.eot differ diff --git a/static/css/fonts/KaTeX_SansSerif-Italic.ttf b/static/css/fonts/KaTeX_SansSerif-Italic.ttf new file mode 100644 index 0000000..b3a2f38 Binary files /dev/null and b/static/css/fonts/KaTeX_SansSerif-Italic.ttf differ diff --git a/static/css/fonts/KaTeX_SansSerif-Italic.woff b/static/css/fonts/KaTeX_SansSerif-Italic.woff new file mode 100644 index 0000000..bddf7ea Binary files /dev/null and b/static/css/fonts/KaTeX_SansSerif-Italic.woff differ diff --git a/static/css/fonts/KaTeX_SansSerif-Italic.woff2 b/static/css/fonts/KaTeX_SansSerif-Italic.woff2 new file mode 100644 index 0000000..5fa767b Binary files /dev/null and b/static/css/fonts/KaTeX_SansSerif-Italic.woff2 differ diff --git a/static/css/fonts/KaTeX_SansSerif-Regular.eot b/static/css/fonts/KaTeX_SansSerif-Regular.eot new file mode 100644 index 0000000..1b38b98 Binary files /dev/null and b/static/css/fonts/KaTeX_SansSerif-Regular.eot differ diff --git a/static/css/fonts/KaTeX_SansSerif-Regular.ttf b/static/css/fonts/KaTeX_SansSerif-Regular.ttf new file mode 100644 index 0000000..e4712f8 Binary files /dev/null and b/static/css/fonts/KaTeX_SansSerif-Regular.ttf differ diff --git a/static/css/fonts/KaTeX_SansSerif-Regular.woff b/static/css/fonts/KaTeX_SansSerif-Regular.woff new file mode 100644 index 0000000..33be368 Binary files /dev/null and b/static/css/fonts/KaTeX_SansSerif-Regular.woff differ diff --git a/static/css/fonts/KaTeX_SansSerif-Regular.woff2 b/static/css/fonts/KaTeX_SansSerif-Regular.woff2 new file mode 100644 index 0000000..4fcb2e2 Binary files /dev/null and b/static/css/fonts/KaTeX_SansSerif-Regular.woff2 differ diff --git a/static/css/fonts/KaTeX_Script-Regular.eot b/static/css/fonts/KaTeX_Script-Regular.eot new file mode 100644 index 0000000..7870d7f Binary files /dev/null and b/static/css/fonts/KaTeX_Script-Regular.eot differ diff --git a/static/css/fonts/KaTeX_Script-Regular.ttf b/static/css/fonts/KaTeX_Script-Regular.ttf new file mode 100644 index 0000000..da4d113 Binary files /dev/null and b/static/css/fonts/KaTeX_Script-Regular.ttf differ diff --git a/static/css/fonts/KaTeX_Script-Regular.woff b/static/css/fonts/KaTeX_Script-Regular.woff new file mode 100644 index 0000000..d6ae79f Binary files /dev/null and b/static/css/fonts/KaTeX_Script-Regular.woff differ diff --git a/static/css/fonts/KaTeX_Script-Regular.woff2 b/static/css/fonts/KaTeX_Script-Regular.woff2 new file mode 100644 index 0000000..1b43deb Binary files /dev/null and b/static/css/fonts/KaTeX_Script-Regular.woff2 differ diff --git a/static/css/fonts/KaTeX_Size1-Regular.eot b/static/css/fonts/KaTeX_Size1-Regular.eot new file mode 100644 index 0000000..29950f9 Binary files /dev/null and b/static/css/fonts/KaTeX_Size1-Regular.eot differ diff --git a/static/css/fonts/KaTeX_Size1-Regular.ttf b/static/css/fonts/KaTeX_Size1-Regular.ttf new file mode 100644 index 0000000..194466a Binary files /dev/null and b/static/css/fonts/KaTeX_Size1-Regular.ttf differ diff --git a/static/css/fonts/KaTeX_Size1-Regular.woff b/static/css/fonts/KaTeX_Size1-Regular.woff new file mode 100644 index 0000000..237f271 Binary files /dev/null and b/static/css/fonts/KaTeX_Size1-Regular.woff differ diff --git a/static/css/fonts/KaTeX_Size1-Regular.woff2 b/static/css/fonts/KaTeX_Size1-Regular.woff2 new file mode 100644 index 0000000..39b6f8f Binary files /dev/null and b/static/css/fonts/KaTeX_Size1-Regular.woff2 differ diff --git a/static/css/fonts/KaTeX_Size2-Regular.eot b/static/css/fonts/KaTeX_Size2-Regular.eot new file mode 100644 index 0000000..b8b0536 Binary files /dev/null and b/static/css/fonts/KaTeX_Size2-Regular.eot differ diff --git a/static/css/fonts/KaTeX_Size2-Regular.ttf b/static/css/fonts/KaTeX_Size2-Regular.ttf new file mode 100644 index 0000000..b41b66a Binary files /dev/null and b/static/css/fonts/KaTeX_Size2-Regular.ttf differ diff --git a/static/css/fonts/KaTeX_Size2-Regular.woff b/static/css/fonts/KaTeX_Size2-Regular.woff new file mode 100644 index 0000000..4a30558 Binary files /dev/null and b/static/css/fonts/KaTeX_Size2-Regular.woff differ diff --git a/static/css/fonts/KaTeX_Size2-Regular.woff2 b/static/css/fonts/KaTeX_Size2-Regular.woff2 new file mode 100644 index 0000000..3facec1 Binary files /dev/null and b/static/css/fonts/KaTeX_Size2-Regular.woff2 differ diff --git a/static/css/fonts/KaTeX_Size3-Regular.eot b/static/css/fonts/KaTeX_Size3-Regular.eot new file mode 100644 index 0000000..576b864 Binary files /dev/null and b/static/css/fonts/KaTeX_Size3-Regular.eot differ diff --git a/static/css/fonts/KaTeX_Size3-Regular.ttf b/static/css/fonts/KaTeX_Size3-Regular.ttf new file mode 100644 index 0000000..790ddbb Binary files /dev/null and b/static/css/fonts/KaTeX_Size3-Regular.ttf differ diff --git a/static/css/fonts/KaTeX_Size3-Regular.woff b/static/css/fonts/KaTeX_Size3-Regular.woff new file mode 100644 index 0000000..3a6d062 Binary files /dev/null and b/static/css/fonts/KaTeX_Size3-Regular.woff differ diff --git a/static/css/fonts/KaTeX_Size3-Regular.woff2 b/static/css/fonts/KaTeX_Size3-Regular.woff2 new file mode 100644 index 0000000..2cffafe Binary files /dev/null and b/static/css/fonts/KaTeX_Size3-Regular.woff2 differ diff --git a/static/css/fonts/KaTeX_Size4-Regular.eot b/static/css/fonts/KaTeX_Size4-Regular.eot new file mode 100644 index 0000000..c2b045f Binary files /dev/null and b/static/css/fonts/KaTeX_Size4-Regular.eot differ diff --git a/static/css/fonts/KaTeX_Size4-Regular.ttf b/static/css/fonts/KaTeX_Size4-Regular.ttf new file mode 100644 index 0000000..ce660aa Binary files /dev/null and b/static/css/fonts/KaTeX_Size4-Regular.ttf differ diff --git a/static/css/fonts/KaTeX_Size4-Regular.woff b/static/css/fonts/KaTeX_Size4-Regular.woff new file mode 100644 index 0000000..7826c6c Binary files /dev/null and b/static/css/fonts/KaTeX_Size4-Regular.woff differ diff --git a/static/css/fonts/KaTeX_Size4-Regular.woff2 b/static/css/fonts/KaTeX_Size4-Regular.woff2 new file mode 100644 index 0000000..c921898 Binary files /dev/null and b/static/css/fonts/KaTeX_Size4-Regular.woff2 differ diff --git a/static/css/fonts/KaTeX_Typewriter-Regular.eot b/static/css/fonts/KaTeX_Typewriter-Regular.eot new file mode 100644 index 0000000..4c178f4 Binary files /dev/null and b/static/css/fonts/KaTeX_Typewriter-Regular.eot differ diff --git a/static/css/fonts/KaTeX_Typewriter-Regular.ttf b/static/css/fonts/KaTeX_Typewriter-Regular.ttf new file mode 100644 index 0000000..b0427ad Binary files /dev/null and b/static/css/fonts/KaTeX_Typewriter-Regular.ttf differ diff --git a/static/css/fonts/KaTeX_Typewriter-Regular.woff b/static/css/fonts/KaTeX_Typewriter-Regular.woff new file mode 100644 index 0000000..78e9904 Binary files /dev/null and b/static/css/fonts/KaTeX_Typewriter-Regular.woff differ diff --git a/static/css/fonts/KaTeX_Typewriter-Regular.woff2 b/static/css/fonts/KaTeX_Typewriter-Regular.woff2 new file mode 100644 index 0000000..618de99 Binary files /dev/null and b/static/css/fonts/KaTeX_Typewriter-Regular.woff2 differ diff --git a/templates/view.tmpl b/templates/view.tmpl index 4b772b6..ec58ce5 100644 --- a/templates/view.tmpl +++ b/templates/view.tmpl @@ -7,7 +7,8 @@ {{ template "header" }} - + + @@ -42,6 +43,17 @@ +