diff --git a/images/bench_round4.PNG b/images/bench_round4.PNG index dc5a5414..aa56e718 100644 Binary files a/images/bench_round4.PNG and b/images/bench_round4.PNG differ diff --git a/images/tempra-conflux.PNG b/images/tempra-conflux.PNG new file mode 100644 index 00000000..43c881e3 Binary files /dev/null and b/images/tempra-conflux.PNG differ diff --git a/plugin_bbcode.go b/plugin_bbcode.go index 3d690bae..6ba7bb70 100644 --- a/plugin_bbcode.go +++ b/plugin_bbcode.go @@ -1,11 +1,10 @@ package main -//import "log" -//import "fmt" import "regexp" var bbcode_bold *regexp.Regexp var bbcode_italic *regexp.Regexp var bbcode_underline *regexp.Regexp +var bbcode_strikethrough *regexp.Regexp var bbcode_url *regexp.Regexp var bbcode_url_label *regexp.Regexp @@ -18,6 +17,7 @@ func init_bbcode() { bbcode_bold = regexp.MustCompile(`(?s)\[b\](.*)\[/b\]`) bbcode_italic = regexp.MustCompile(`(?s)\[i\](.*)\[/i\]`) bbcode_underline = regexp.MustCompile(`(?s)\[u\](.*)\[/u\]`) + bbcode_strikethrough = regexp.MustCompile(`(?s)\[s\](.*)\[/s\]`) urlpattern := `(http|https|ftp|mailto*)(:??)\/\/([\.a-zA-Z\/]+)` bbcode_url = regexp.MustCompile(`\[url\]` + urlpattern + `\[/url\]`) bbcode_url_label = regexp.MustCompile(`(?s)\[url=` + urlpattern + `\](.*)\[/url\]`) @@ -31,6 +31,8 @@ func bbcode_parse(data interface{}) interface{} { msg := data.(string) msg = bbcode_bold.ReplaceAllString(msg,"$1") msg = bbcode_italic.ReplaceAllString(msg,"$1") + msg = bbcode_underline.ReplaceAllString(msg,"$1") + msg = bbcode_strikethrough.ReplaceAllString(msg,"$1") msg = bbcode_url.ReplaceAllString(msg,"$1$2//$3") msg = bbcode_url_label.ReplaceAllString(msg,"$4") return msg @@ -42,29 +44,29 @@ func bbcode_parse2(data interface{}) interface{} { has_u := false has_b := false has_i := false + has_s := false complex_bbc := false for i := 0; i < len(msgbytes); i++ { - //log.Print(msgbytes[i]) - //fmt.Println(string(msgbytes[i])) - //continue if msgbytes[i] == '[' { if msgbytes[i + 2] != ']' { if msgbytes[i + 1] == '/' { if msgbytes[i + 3] == ']' { - if msgbytes[i + 2] == 'u' { - msgbytes[i] = '<' - msgbytes[i + 3] = '>' - has_u = false - } if msgbytes[i + 2] == 'b' { msgbytes[i] = '<' msgbytes[i + 3] = '>' has_b = false - } - if msgbytes[i + 2] == 'i' { + } 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 { @@ -74,20 +76,22 @@ func bbcode_parse2(data interface{}) interface{} { complex_bbc = true } } else { - if msgbytes[i + 1] == 'u' { - msgbytes[i] = '<' - msgbytes[i + 2] = '>' - has_u = true - } if msgbytes[i + 1] == 'b' { msgbytes[i] = '<' msgbytes[i + 2] = '>' has_b = true - } - if msgbytes[i + 1] == 'i' { + } 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 } @@ -95,12 +99,11 @@ func bbcode_parse2(data interface{}) interface{} { } // There's an unclosed tag in there x.x - if has_i || has_u || has_b { - closer := []byte("") + if has_i || has_u || has_b || has_s { + closer := []byte("") msgbytes = append(msgbytes, closer...) } msg = string(msgbytes) - //fmt.Println(msg) if complex_bbc { msg = bbcode_url.ReplaceAllString(msg,"$1$2//$3") diff --git a/template_topics.go b/template_topics.go index 50989ce0..f45f1c3c 100644 --- a/template_topics.go +++ b/template_topics.go @@ -1,7 +1,7 @@ /* This file was automatically generated by the software. Please don't edit it as your changes may be overwritten at any moment. */ package main -import "io" import "strconv" +import "io" func init() { template_topics_handle = template_topics diff --git a/themes/tempra-conflux/tempra-conflux.PNG b/themes/tempra-conflux/tempra-conflux.PNG new file mode 100644 index 00000000..43c881e3 Binary files /dev/null and b/themes/tempra-conflux/tempra-conflux.PNG differ