mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-17 07:00:12 +01:00
✨ Callout block https://github.com/siyuan-note/siyuan/issues/16051
Signed-off-by: Daniel <845765@qq.com>
This commit is contained in:
parent
c1cdb9846c
commit
362f6ffa05
2 changed files with 10 additions and 0 deletions
|
|
@ -42,6 +42,7 @@ type Search struct {
|
|||
VideoBlock bool `json:"videoBlock"`
|
||||
IFrameBlock bool `json:"iframeBlock"`
|
||||
WidgetBlock bool `json:"widgetBlock"`
|
||||
Callout bool `json:"callout"`
|
||||
|
||||
Limit int `json:"limit"`
|
||||
CaseSensitive bool `json:"caseSensitive"`
|
||||
|
|
@ -84,6 +85,7 @@ func NewSearch() *Search {
|
|||
VideoBlock: false,
|
||||
IFrameBlock: false,
|
||||
WidgetBlock: false,
|
||||
Callout: false,
|
||||
|
||||
Limit: 64,
|
||||
CaseSensitive: false,
|
||||
|
|
@ -227,6 +229,12 @@ func (s *Search) TypeFilter() string {
|
|||
buf.WriteByte('\'')
|
||||
buf.WriteString(",")
|
||||
}
|
||||
if s.Callout {
|
||||
buf.WriteByte('\'')
|
||||
buf.WriteString(treenode.TypeAbbr(ast.NodeCallout.String()))
|
||||
buf.WriteByte('\'')
|
||||
buf.WriteString(",")
|
||||
}
|
||||
|
||||
ret := buf.String()
|
||||
if "" == ret {
|
||||
|
|
|
|||
|
|
@ -1433,6 +1433,7 @@ func buildTypeFilter(types map[string]bool) string {
|
|||
s.VideoBlock = types["videoBlock"]
|
||||
s.IFrameBlock = types["iframeBlock"]
|
||||
s.WidgetBlock = types["widgetBlock"]
|
||||
s.Callout = types["callout"]
|
||||
} else {
|
||||
s.Document = Conf.Search.Document
|
||||
s.Heading = Conf.Search.Heading
|
||||
|
|
@ -1451,6 +1452,7 @@ func buildTypeFilter(types map[string]bool) string {
|
|||
s.VideoBlock = Conf.Search.VideoBlock
|
||||
s.IFrameBlock = Conf.Search.IFrameBlock
|
||||
s.WidgetBlock = Conf.Search.WidgetBlock
|
||||
s.Callout = Conf.Search.Callout
|
||||
}
|
||||
return s.TypeFilter()
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue