Skip to content

Commit 49f809b

Browse files
committed
删除更多的tag
1 parent 16c2b6b commit 49f809b

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

eino/eino.go

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,9 +70,12 @@ func (x *Eino) PrettyRes(sql, question string, runResult []map[string]interface{
7070

7171
// 如果有sql tag 就删除
7272
func trimSql(sql string) string {
73-
if strings.HasPrefix(sql, "```sql\n") {
74-
sql = strings.TrimLeft(sql, "```sql\n")
75-
sql = strings.TrimRight(sql, "\n```")
73+
list := []string{"```sql", "```"}
74+
for _, s := range list {
75+
if strings.HasPrefix(sql, s) {
76+
sql = strings.TrimLeft(sql, s)
77+
sql = strings.TrimRight(sql, "```")
78+
}
7679
}
7780
return sql
7881
}

0 commit comments

Comments
 (0)