2017-01-05 14:41:14 +00:00
|
|
|
package main
|
2017-01-08 16:02:19 +00:00
|
|
|
//import "log"
|
2017-01-26 13:37:50 +00:00
|
|
|
//import "fmt"
|
2017-01-08 16:02:19 +00:00
|
|
|
import "bytes"
|
2017-01-07 06:31:04 +00:00
|
|
|
//import "strings"
|
2017-01-17 07:55:46 +00:00
|
|
|
import "strconv"
|
2017-01-05 14:41:14 +00:00
|
|
|
import "regexp"
|
2017-01-17 07:55:46 +00:00
|
|
|
import "time"
|
|
|
|
import "math/rand"
|
2017-01-05 14:41:14 +00:00
|
|
|
|
2017-01-17 07:55:46 +00:00
|
|
|
var random *rand.Rand
|
|
|
|
var bbcode_invalid_number []byte
|
|
|
|
var bbcode_missing_tag []byte
|
2017-01-26 13:37:50 +00:00
|
|
|
|
2017-01-05 14:41:14 +00:00
|
|
|
var bbcode_bold *regexp.Regexp
|
|
|
|
var bbcode_italic *regexp.Regexp
|
|
|
|
var bbcode_underline *regexp.Regexp
|
2017-01-05 14:59:15 +00:00
|
|
|
var bbcode_strikethrough *regexp.Regexp
|
2017-01-05 14:41:14 +00:00
|
|
|
var bbcode_url *regexp.Regexp
|
|
|
|
var bbcode_url_label *regexp.Regexp
|
2017-03-07 07:22:29 +00:00
|
|
|
var bbcode_quotes *regexp.Regexp
|
2017-01-05 14:41:14 +00:00
|
|
|
|
|
|
|
func init() {
|
|
|
|
plugins["bbcode"] = NewPlugin("bbcode","BBCode","Azareal","http://github.com/Azareal","","","",init_bbcode,nil,deactivate_bbcode)
|
|
|
|
}
|
|
|
|
|
|
|
|
func init_bbcode() {
|
2017-01-08 16:02:19 +00:00
|
|
|
//plugins["bbcode"].AddHook("parse_assign", bbcode_parse_without_code)
|
|
|
|
plugins["bbcode"].AddHook("parse_assign", bbcode_full_parse)
|
|
|
|
|
2017-01-17 07:55:46 +00:00
|
|
|
bbcode_invalid_number = []byte("<span style='color: red;'>[Invalid Number]</span>")
|
|
|
|
bbcode_missing_tag = []byte("<span style='color: red;'>[Missing Tag]</span>")
|
2017-01-07 06:31:04 +00:00
|
|
|
|
2017-01-05 14:41:14 +00:00
|
|
|
bbcode_bold = regexp.MustCompile(`(?s)\[b\](.*)\[/b\]`)
|
|
|
|
bbcode_italic = regexp.MustCompile(`(?s)\[i\](.*)\[/i\]`)
|
|
|
|
bbcode_underline = regexp.MustCompile(`(?s)\[u\](.*)\[/u\]`)
|
2017-01-05 14:59:15 +00:00
|
|
|
bbcode_strikethrough = regexp.MustCompile(`(?s)\[s\](.*)\[/s\]`)
|
2017-01-05 14:41:14 +00:00
|
|
|
urlpattern := `(http|https|ftp|mailto*)(:??)\/\/([\.a-zA-Z\/]+)`
|
|
|
|
bbcode_url = regexp.MustCompile(`\[url\]` + urlpattern + `\[/url\]`)
|
|
|
|
bbcode_url_label = regexp.MustCompile(`(?s)\[url=` + urlpattern + `\](.*)\[/url\]`)
|
2017-03-07 07:22:29 +00:00
|
|
|
bbcode_quotes = regexp.MustCompile(`\[quote\](.*)\[/quote\]`)
|
2017-01-17 07:55:46 +00:00
|
|
|
|
|
|
|
random = rand.New(rand.NewSource(time.Now().UnixNano()))
|
2017-01-05 14:41:14 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func deactivate_bbcode() {
|
2017-01-08 16:02:19 +00:00
|
|
|
//plugins["bbcode"].RemoveHook("parse_assign", bbcode_parse_without_code)
|
|
|
|
plugins["bbcode"].RemoveHook("parse_assign", bbcode_full_parse)
|
2017-01-05 14:41:14 +00:00
|
|
|
}
|
|
|
|
|
2017-01-07 06:31:04 +00:00
|
|
|
func bbcode_regex_parse(data interface{}) interface{} {
|
2017-01-05 14:41:14 +00:00
|
|
|
msg := data.(string)
|
|
|
|
msg = bbcode_bold.ReplaceAllString(msg,"<b>$1</b>")
|
|
|
|
msg = bbcode_italic.ReplaceAllString(msg,"<i>$1</i>")
|
2017-01-05 14:59:15 +00:00
|
|
|
msg = bbcode_underline.ReplaceAllString(msg,"<u>$1</u>")
|
|
|
|
msg = bbcode_strikethrough.ReplaceAllString(msg,"<s>$1</s>")
|
2017-01-05 14:41:14 +00:00
|
|
|
msg = bbcode_url.ReplaceAllString(msg,"<a href=\"$1$2//$3\" rel=\"nofollow\">$1$2//$3</i>")
|
|
|
|
msg = bbcode_url_label.ReplaceAllString(msg,"<a href=\"$1$2//$3\" rel=\"nofollow\">$4</i>")
|
2017-03-07 07:22:29 +00:00
|
|
|
msg = bbcode_quotes.ReplaceAllString(msg,"<div class=\"postQuote\">$1</div>")
|
2017-01-05 14:41:14 +00:00
|
|
|
return msg
|
|
|
|
}
|
|
|
|
|
2017-01-07 06:31:04 +00:00
|
|
|
// Only does the simple BBCode like [u], [b], [i] and [s]
|
|
|
|
func bbcode_simple_parse(data interface{}) interface{} {
|
|
|
|
msg := data.(string)
|
|
|
|
msgbytes := []byte(msg)
|
|
|
|
has_u := false
|
|
|
|
has_b := false
|
|
|
|
has_i := false
|
|
|
|
has_s := false
|
2017-01-17 07:55:46 +00:00
|
|
|
for i := 0; (i + 2) < len(msgbytes); i++ {
|
2017-01-07 06:31:04 +00:00
|
|
|
if msgbytes[i] == '[' && msgbytes[i + 2] == ']' {
|
|
|
|
if msgbytes[i + 1] == 'b' {
|
|
|
|
msgbytes[i] = '<'
|
|
|
|
msgbytes[i + 2] = '>'
|
|
|
|
has_b = true
|
|
|
|
} else if msgbytes[i + 1] == 'i' {
|
|
|
|
msgbytes[i] = '<'
|
|
|
|
msgbytes[i + 2] = '>'
|
|
|
|
has_i = true
|
|
|
|
} else if msgbytes[i + 1] == 'u' {
|
|
|
|
msgbytes[i] = '<'
|
|
|
|
msgbytes[i + 2] = '>'
|
|
|
|
has_u = true
|
|
|
|
} else if msgbytes[i + 1] == 's' {
|
|
|
|
msgbytes[i] = '<'
|
|
|
|
msgbytes[i + 2] = '>'
|
|
|
|
has_s = true
|
|
|
|
}
|
|
|
|
i += 2
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// There's an unclosed tag in there x.x
|
|
|
|
if has_i || has_u || has_b || has_s {
|
|
|
|
closer := []byte("</u></i></b></s>")
|
|
|
|
msgbytes = append(msgbytes, closer...)
|
|
|
|
}
|
|
|
|
return string(msgbytes)
|
|
|
|
}
|
|
|
|
|
|
|
|
// Here for benchmarking purposes. Might add a plugin setting for disabling [code] as it has it's paws everywhere
|
|
|
|
func bbcode_parse_without_code(data interface{}) interface{} {
|
2017-01-05 14:41:14 +00:00
|
|
|
msg := data.(string)
|
|
|
|
msgbytes := []byte(msg)
|
|
|
|
has_u := false
|
|
|
|
has_b := false
|
|
|
|
has_i := false
|
2017-01-05 14:59:15 +00:00
|
|
|
has_s := false
|
2017-01-05 14:41:14 +00:00
|
|
|
complex_bbc := false
|
2017-01-21 18:16:27 +00:00
|
|
|
for i := 0; (i + 3) < len(msgbytes); i++ {
|
2017-01-05 14:41:14 +00:00
|
|
|
if msgbytes[i] == '[' {
|
|
|
|
if msgbytes[i + 2] != ']' {
|
|
|
|
if msgbytes[i + 1] == '/' {
|
|
|
|
if msgbytes[i + 3] == ']' {
|
|
|
|
if msgbytes[i + 2] == 'b' {
|
|
|
|
msgbytes[i] = '<'
|
|
|
|
msgbytes[i + 3] = '>'
|
|
|
|
has_b = false
|
2017-01-05 14:59:15 +00:00
|
|
|
} else if msgbytes[i + 2] == 'i' {
|
2017-01-05 14:41:14 +00:00
|
|
|
msgbytes[i] = '<'
|
|
|
|
msgbytes[i + 3] = '>'
|
|
|
|
has_i = false
|
2017-01-05 14:59:15 +00:00
|
|
|
} else if msgbytes[i + 2] == 'u' {
|
|
|
|
msgbytes[i] = '<'
|
|
|
|
msgbytes[i + 3] = '>'
|
|
|
|
has_u = false
|
|
|
|
} else if msgbytes[i + 2] == 's' {
|
|
|
|
msgbytes[i] = '<'
|
|
|
|
msgbytes[i + 3] = '>'
|
|
|
|
has_s = false
|
2017-01-05 14:41:14 +00:00
|
|
|
}
|
|
|
|
i += 3
|
|
|
|
} else {
|
|
|
|
complex_bbc = true
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
complex_bbc = true
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
if msgbytes[i + 1] == 'b' {
|
|
|
|
msgbytes[i] = '<'
|
|
|
|
msgbytes[i + 2] = '>'
|
|
|
|
has_b = true
|
2017-01-05 14:59:15 +00:00
|
|
|
} else if msgbytes[i + 1] == 'i' {
|
2017-01-05 14:41:14 +00:00
|
|
|
msgbytes[i] = '<'
|
|
|
|
msgbytes[i + 2] = '>'
|
|
|
|
has_i = true
|
2017-01-05 14:59:15 +00:00
|
|
|
} else if msgbytes[i + 1] == 'u' {
|
|
|
|
msgbytes[i] = '<'
|
|
|
|
msgbytes[i + 2] = '>'
|
|
|
|
has_u = true
|
|
|
|
} else if msgbytes[i + 1] == 's' {
|
|
|
|
msgbytes[i] = '<'
|
|
|
|
msgbytes[i + 2] = '>'
|
|
|
|
has_s = true
|
2017-01-05 14:41:14 +00:00
|
|
|
}
|
|
|
|
i += 2
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// There's an unclosed tag in there x.x
|
2017-01-05 14:59:15 +00:00
|
|
|
if has_i || has_u || has_b || has_s {
|
|
|
|
closer := []byte("</u></i></b></s>")
|
2017-01-05 14:41:14 +00:00
|
|
|
msgbytes = append(msgbytes, closer...)
|
|
|
|
}
|
|
|
|
|
2017-01-21 18:16:27 +00:00
|
|
|
// Copy the new complex parser over once the rough edges have been smoothed over
|
2017-01-05 14:41:14 +00:00
|
|
|
if complex_bbc {
|
|
|
|
msg = bbcode_url.ReplaceAllString(msg,"<a href=\"$1$2//$3\" rel=\"nofollow\">$1$2//$3</i>")
|
|
|
|
msg = bbcode_url_label.ReplaceAllString(msg,"<a href=\"$1$2//$3\" rel=\"nofollow\">$4</i>")
|
2017-03-07 07:22:29 +00:00
|
|
|
msg = bbcode_quotes.ReplaceAllString(msg,"<div class=\"postQuote\">$1</div>")
|
2017-01-05 14:41:14 +00:00
|
|
|
}
|
2017-01-08 16:02:19 +00:00
|
|
|
return string(msgbytes)
|
2017-01-07 06:31:04 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// Does every type of BBCode
|
|
|
|
func bbcode_full_parse(data interface{}) interface{} {
|
|
|
|
msg := data.(string)
|
2017-03-07 07:22:29 +00:00
|
|
|
//fmt.Println("BBCode PrePre String:")
|
|
|
|
//fmt.Println("`"+msg+"`")
|
|
|
|
//fmt.Println("----")
|
2017-01-07 06:31:04 +00:00
|
|
|
msgbytes := []byte(msg)
|
|
|
|
has_u := false
|
|
|
|
has_b := false
|
|
|
|
has_i := false
|
|
|
|
has_s := false
|
|
|
|
has_c := false
|
|
|
|
complex_bbc := false
|
2017-03-07 07:22:29 +00:00
|
|
|
msgbytes = append(msgbytes,space_gap...)
|
|
|
|
//fmt.Println("BBCode Simple Pre:")
|
|
|
|
//fmt.Println("`"+string(msgbytes)+"`")
|
|
|
|
//fmt.Println("----")
|
2017-01-26 13:37:50 +00:00
|
|
|
for i := 0; i < len(msgbytes); i++ {
|
2017-01-07 06:31:04 +00:00
|
|
|
if msgbytes[i] == '[' {
|
|
|
|
if msgbytes[i + 2] != ']' {
|
|
|
|
if msgbytes[i + 1] == '/' {
|
|
|
|
if msgbytes[i + 3] == ']' {
|
|
|
|
if !has_c {
|
|
|
|
if msgbytes[i + 2] == 'b' {
|
|
|
|
msgbytes[i] = '<'
|
|
|
|
msgbytes[i + 3] = '>'
|
|
|
|
has_b = false
|
|
|
|
} else if msgbytes[i + 2] == 'i' {
|
|
|
|
msgbytes[i] = '<'
|
|
|
|
msgbytes[i + 3] = '>'
|
|
|
|
has_i = false
|
|
|
|
} else if msgbytes[i + 2] == 'u' {
|
|
|
|
msgbytes[i] = '<'
|
|
|
|
msgbytes[i + 3] = '>'
|
|
|
|
has_u = false
|
|
|
|
} else if msgbytes[i + 2] == 's' {
|
|
|
|
msgbytes[i] = '<'
|
|
|
|
msgbytes[i + 3] = '>'
|
|
|
|
has_s = false
|
|
|
|
}
|
|
|
|
i += 3
|
|
|
|
}
|
|
|
|
} else {
|
2017-01-26 13:37:50 +00:00
|
|
|
if msgbytes[i+2] == 'c' && msgbytes[i+3] == 'o' && msgbytes[i+4] == 'd' && msgbytes[i+5] == 'e' && msgbytes[i+6] == ']' {
|
2017-01-07 06:31:04 +00:00
|
|
|
has_c = false
|
2017-01-21 18:16:27 +00:00
|
|
|
i += 7
|
2017-01-07 06:31:04 +00:00
|
|
|
}
|
2017-01-21 18:16:27 +00:00
|
|
|
//if msglen >= (i+6) {
|
|
|
|
// fmt.Println("boo")
|
|
|
|
// fmt.Println(msglen)
|
|
|
|
// fmt.Println(i+6)
|
|
|
|
// fmt.Println(string(msgbytes[i:i+6]))
|
|
|
|
//}
|
2017-01-07 06:31:04 +00:00
|
|
|
complex_bbc = true
|
|
|
|
}
|
|
|
|
} else {
|
2017-01-26 13:37:50 +00:00
|
|
|
if msgbytes[i+1] == 'c' && msgbytes[i+2] == 'o' && msgbytes[i+3] == 'd' && msgbytes[i+4] == 'e' && msgbytes[i+5] == ']' {
|
2017-01-07 06:31:04 +00:00
|
|
|
has_c = true
|
2017-01-21 18:16:27 +00:00
|
|
|
i += 6
|
2017-01-07 06:31:04 +00:00
|
|
|
}
|
2017-01-21 18:16:27 +00:00
|
|
|
//if msglen >= (i+5) {
|
|
|
|
// fmt.Println("boo2")
|
|
|
|
// fmt.Println(string(msgbytes[i:i+5]))
|
|
|
|
//}
|
2017-01-07 06:31:04 +00:00
|
|
|
complex_bbc = true
|
|
|
|
}
|
|
|
|
} else if !has_c {
|
|
|
|
if msgbytes[i + 1] == 'b' {
|
|
|
|
msgbytes[i] = '<'
|
|
|
|
msgbytes[i + 2] = '>'
|
|
|
|
has_b = true
|
|
|
|
} else if msgbytes[i + 1] == 'i' {
|
|
|
|
msgbytes[i] = '<'
|
|
|
|
msgbytes[i + 2] = '>'
|
|
|
|
has_i = true
|
|
|
|
} else if msgbytes[i + 1] == 'u' {
|
|
|
|
msgbytes[i] = '<'
|
|
|
|
msgbytes[i + 2] = '>'
|
|
|
|
has_u = true
|
|
|
|
} else if msgbytes[i + 1] == 's' {
|
|
|
|
msgbytes[i] = '<'
|
|
|
|
msgbytes[i + 2] = '>'
|
|
|
|
has_s = true
|
|
|
|
}
|
|
|
|
i += 2
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// There's an unclosed tag in there x.x
|
|
|
|
if has_i || has_u || has_b || has_s {
|
|
|
|
closer := []byte("</u></i></b></s>")
|
|
|
|
msgbytes = append(msgbytes, closer...)
|
|
|
|
}
|
|
|
|
|
|
|
|
if complex_bbc {
|
2017-01-21 18:16:27 +00:00
|
|
|
i := 0
|
2017-01-08 16:02:19 +00:00
|
|
|
var start int
|
|
|
|
var lastTag int
|
2017-01-26 13:37:50 +00:00
|
|
|
outbytes := make([]byte, len(msgbytes))
|
2017-03-07 07:22:29 +00:00
|
|
|
//fmt.Println("BBCode Pre:")
|
|
|
|
//fmt.Println("`"+string(msgbytes)+"`")
|
|
|
|
//fmt.Println("----")
|
2017-01-26 13:37:50 +00:00
|
|
|
for ; i < len(msgbytes); i++ {
|
2017-01-08 16:02:19 +00:00
|
|
|
MainLoop:
|
|
|
|
if msgbytes[i] == '[' {
|
|
|
|
OuterComplex:
|
|
|
|
if msgbytes[i + 1] == 'u' {
|
2017-01-26 13:37:50 +00:00
|
|
|
if msgbytes[i+2] == 'r' && msgbytes[i+3] == 'l' && msgbytes[i+4] == ']' {
|
2017-01-08 16:02:19 +00:00
|
|
|
start = i + 5
|
2017-03-07 07:22:29 +00:00
|
|
|
outbytes = append(outbytes, msgbytes[lastTag:i]...)
|
2017-01-08 16:02:19 +00:00
|
|
|
i = start
|
2017-03-07 07:22:29 +00:00
|
|
|
i += partial_url_bytes_len(msgbytes[start:])
|
2017-01-08 16:02:19 +00:00
|
|
|
|
2017-03-07 07:22:29 +00:00
|
|
|
//fmt.Println("Partial Bytes:")
|
|
|
|
//fmt.Println(string(msgbytes[start:]))
|
|
|
|
//fmt.Println("-----")
|
|
|
|
if !bytes.Equal(msgbytes[i:i+6],[]byte("[/url]")) {
|
|
|
|
//fmt.Println("Invalid Bytes:")
|
|
|
|
//fmt.Println(string(msgbytes[i:i+6]))
|
|
|
|
//fmt.Println("-----")
|
|
|
|
outbytes = append(outbytes, invalid_url...)
|
|
|
|
goto MainLoop
|
2017-01-08 16:02:19 +00:00
|
|
|
}
|
2017-03-07 07:22:29 +00:00
|
|
|
|
|
|
|
outbytes = append(outbytes, url_open...)
|
2017-01-08 16:02:19 +00:00
|
|
|
outbytes = append(outbytes, msgbytes[start:i]...)
|
2017-03-07 07:22:29 +00:00
|
|
|
outbytes = append(outbytes, url_open2...)
|
2017-01-08 16:02:19 +00:00
|
|
|
outbytes = append(outbytes, msgbytes[start:i]...)
|
2017-03-07 07:22:29 +00:00
|
|
|
outbytes = append(outbytes, url_close...)
|
2017-01-08 16:02:19 +00:00
|
|
|
i += 6
|
|
|
|
lastTag = i
|
|
|
|
}
|
2017-01-17 07:55:46 +00:00
|
|
|
} else if msgbytes[i + 1] == 'r' {
|
2017-01-26 13:37:50 +00:00
|
|
|
if bytes.Equal(msgbytes[i+2:i+6],[]byte("and]")) {
|
2017-01-17 07:55:46 +00:00
|
|
|
outbytes = append(outbytes, msgbytes[lastTag:i]...)
|
|
|
|
start = i + 6
|
|
|
|
i = start
|
|
|
|
for ;; i++ {
|
|
|
|
if msgbytes[i] == '[' {
|
|
|
|
if !bytes.Equal(msgbytes[i+1:i+7],[]byte("/rand]")) {
|
|
|
|
outbytes = append(outbytes, bbcode_missing_tag...)
|
|
|
|
goto OuterComplex
|
|
|
|
}
|
|
|
|
break
|
2017-01-26 13:37:50 +00:00
|
|
|
} else if (len(msgbytes) - 1) < (i + 10) {
|
2017-01-17 07:55:46 +00:00
|
|
|
outbytes = append(outbytes, bbcode_missing_tag...)
|
|
|
|
goto OuterComplex
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
number, err := strconv.ParseInt(string(msgbytes[start:i]),10,64)
|
|
|
|
if err != nil {
|
|
|
|
outbytes = append(outbytes, bbcode_invalid_number...)
|
|
|
|
goto MainLoop
|
|
|
|
}
|
|
|
|
|
|
|
|
dat := []byte(strconv.FormatInt((random.Int63n(number)),10))
|
|
|
|
outbytes = append(outbytes, dat...)
|
|
|
|
//log.Print("Outputted the random number")
|
2017-01-21 18:16:27 +00:00
|
|
|
i += 7
|
2017-01-17 07:55:46 +00:00
|
|
|
lastTag = i
|
|
|
|
}
|
2017-01-08 16:02:19 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2017-01-17 07:55:46 +00:00
|
|
|
//fmt.Println(string(outbytes))
|
2017-01-21 18:16:27 +00:00
|
|
|
if lastTag != i {
|
2017-02-28 09:27:28 +00:00
|
|
|
outbytes = append(outbytes, msgbytes[lastTag:]...)
|
2017-03-07 07:22:29 +00:00
|
|
|
//fmt.Println("Outbytes:")
|
|
|
|
//fmt.Println(`"`+string(outbytes)+`"`)
|
|
|
|
//fmt.Println("----")
|
2017-01-21 18:16:27 +00:00
|
|
|
}
|
2017-03-07 07:22:29 +00:00
|
|
|
|
2017-01-08 16:02:19 +00:00
|
|
|
if len(outbytes) != 0 {
|
2017-03-07 07:22:29 +00:00
|
|
|
//fmt.Println("BBCode Post:")
|
|
|
|
//fmt.Println(`"`+string(outbytes[0:len(outbytes) - 10])+`"`)
|
|
|
|
//fmt.Println("----")
|
|
|
|
msg = string(outbytes[0:len(outbytes) - 10])
|
|
|
|
} else {
|
|
|
|
msg = string(msgbytes[0:len(msgbytes) - 10])
|
2017-01-08 16:02:19 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
//msg = bbcode_url.ReplaceAllString(msg,"<a href=\"$1$2//$3\" rel=\"nofollow\">$1$2//$3</i>")
|
2017-01-07 06:31:04 +00:00
|
|
|
msg = bbcode_url_label.ReplaceAllString(msg,"<a href=\"$1$2//$3\" rel=\"nofollow\">$4</i>")
|
2017-03-07 07:22:29 +00:00
|
|
|
msg = bbcode_quotes.ReplaceAllString(msg,"<div class=\"postQuote\">$1</div>")
|
2017-01-08 16:02:19 +00:00
|
|
|
// Convert [code] into class="codequotes"
|
2017-03-07 07:22:29 +00:00
|
|
|
//fmt.Println("guuuaaaa")
|
2017-01-08 16:02:19 +00:00
|
|
|
} else {
|
2017-02-28 09:27:28 +00:00
|
|
|
msg = string(msgbytes[0:len(msgbytes) - 10])
|
2017-01-07 06:31:04 +00:00
|
|
|
}
|
|
|
|
return msg
|
2017-01-17 07:55:46 +00:00
|
|
|
}
|