From 5675affcc935494939f2c518bb5193676cb01d39 Mon Sep 17 00:00:00 2001 From: shaoying Date: Tue, 28 Jul 2020 19:46:27 +0800 Subject: [PATCH 1/2] opt some --- core/wiki/chart.go | 5 +++-- meta.go | 3 +++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/core/wiki/chart.go b/core/wiki/chart.go index db8afb3a..3225a99c 100644 --- a/core/wiki/chart.go +++ b/core/wiki/chart.go @@ -198,6 +198,7 @@ func (b *Chain) Init(m *ice.Message, arg ...string) Chart { b.MarginX = kit.Int(m.Option("marginx")) b.MarginY = kit.Int(m.Option("marginy")) + m.Debug("what %v", arg) // 解析数据 b.data = kit.Parse(nil, "", b.show(m, arg[0])...).(map[string]interface{}) @@ -215,7 +216,7 @@ func (b *Chain) Draw(m *ice.Message, x, y int) Chart { } func (b *Chain) show(m *ice.Message, str string) (res []string) { miss := []int{} - for _, line := range kit.Split(str, "\n") { + for _, line := range kit.Split(str, "\n", "\n") { // 计算缩进 dep := 0 loop: @@ -251,7 +252,7 @@ func (b *Chain) show(m *ice.Message, str string) (res []string) { } // 输出节点 - word := kit.Split(line) + word := kit.Split(line, "\t ", "\t ") res = append(res, "{", kit.MDB_META, "{", "text") res = append(res, word...) res = append(res, "}", kit.MDB_LIST, "[") diff --git a/meta.go b/meta.go index e3be92a3..49be484a 100644 --- a/meta.go +++ b/meta.go @@ -362,6 +362,9 @@ func (m *Message) Split(str string, field string, space string, enter string) *M indexs := []int{} fields := kit.Split(field, space, space, space) for i, l := range kit.Split(str, enter, enter, enter) { + if strings.HasPrefix(l, "Binary") { + continue + } if strings.TrimSpace(l) == "" { continue } From 62c4a5396375bd3e30071b82d125ddf04d6d4b78 Mon Sep 17 00:00:00 2001 From: shaoying Date: Wed, 29 Jul 2020 09:20:03 +0800 Subject: [PATCH 2/2] opt some --- core/chat/paste.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/core/chat/paste.go b/core/chat/paste.go index 4bc184dc..b4fd1f5a 100644 --- a/core/chat/paste.go +++ b/core/chat/paste.go @@ -28,7 +28,9 @@ func init() { m.Save(PASTE) }}, - PASTE: {Name: "paste text auto 添加:button", Help: "粘贴板", Action: map[string]*ice.Action{ + PASTE: {Name: "paste text auto 添加:button", Help: "粘贴板", Meta: kit.Dict( + "display", "/plugin/story/paste", + ), Action: map[string]*ice.Action{ mdb.INSERT: {Name: "insert type name text", Hand: func(m *ice.Message, arg ...string) { m.Conf(PASTE, kit.Keys(kit.MDB_META, m.Option(ice.MSG_RIVER), m.Option(ice.MSG_STORM), kit.MDB_META, kit.MDB_SHORT), kit.MDB_TEXT)