mirror of
				https://github.com/schollz/cowyo.git
				synced 2023-08-10 21:13:00 +03:00 
			
		
		
		
	Removed case senstivity from savin
This commit is contained in:
		| @@ -64,7 +64,6 @@ func renderMarkdown(c *gin.Context, title string) { | |||||||
| 	unsafe := blackfriday.MarkdownCommon([]byte(p.CurrentText)) | 	unsafe := blackfriday.MarkdownCommon([]byte(p.CurrentText)) | ||||||
| 	html := bluemonday.UGCPolicy().SanitizeBytes(unsafe) | 	html := bluemonday.UGCPolicy().SanitizeBytes(unsafe) | ||||||
| 	html2 := string(html) | 	html2 := string(html) | ||||||
|  |  | ||||||
| 	r, _ := regexp.Compile("\\$\\$(.*?)\\$\\$") | 	r, _ := regexp.Compile("\\$\\$(.*?)\\$\\$") | ||||||
| 	for _, s := range r.FindAllString(html2, -1) { | 	for _, s := range r.FindAllString(html2, -1) { | ||||||
| 		html2 = strings.Replace(html2, s, "<span class='texp' data-expr='"+s[2:len(s)-2]+"'></span>", 1) | 		html2 = strings.Replace(html2, s, "<span class='texp' data-expr='"+s[2:len(s)-2]+"'></span>", 1) | ||||||
|   | |||||||
| @@ -308,6 +308,6 @@ padding: 0.4em 1em 6em; | |||||||
| background: #fff; | background: #fff; | ||||||
| } | } | ||||||
| .yue { | .yue { | ||||||
| max-width: 650px; | max-width: 675px; | ||||||
| margin: 0 auto; | margin: 0 auto; | ||||||
| } | } | ||||||
|   | |||||||
| @@ -4,6 +4,7 @@ import ( | |||||||
| 	"encoding/json" | 	"encoding/json" | ||||||
| 	"fmt" | 	"fmt" | ||||||
| 	"net/http" | 	"net/http" | ||||||
|  | 	"strings" | ||||||
|  |  | ||||||
| 	"github.com/gorilla/websocket" | 	"github.com/gorilla/websocket" | ||||||
| ) | ) | ||||||
| @@ -40,7 +41,7 @@ func wshandler(w http.ResponseWriter, r *http.Request) { | |||||||
| 		} | 		} | ||||||
|  |  | ||||||
| 		var p CowyoData | 		var p CowyoData | ||||||
| 		err = p.load(m.Title) | 		err = p.load(strings.ToLower(m.Title)) | ||||||
| 		if err != nil { | 		if err != nil { | ||||||
| 			panic(err) | 			panic(err) | ||||||
| 		} | 		} | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 Zack Scholl
					Zack Scholl