Merge remote-tracking branch 'origin/dev' into dev
This commit is contained in:
commit
38012d444a
6 changed files with 25 additions and 12 deletions
2
app/stage/protyle/js/lute/lute.min.js
vendored
2
app/stage/protyle/js/lute/lute.min.js
vendored
File diff suppressed because one or more lines are too long
|
@ -95,7 +95,7 @@ func getBacklink2(c *gin.Context) {
|
|||
if nil != sortArg {
|
||||
sort, _ = strconv.Atoi(sortArg.(string))
|
||||
}
|
||||
mentionSortArg := arg["msort"]
|
||||
mentionSortArg := arg["mSort"]
|
||||
mentionSort := util.SortModeUpdatedDESC
|
||||
if nil != mentionSortArg {
|
||||
mentionSort, _ = strconv.Atoi(mentionSortArg.(string))
|
||||
|
|
|
@ -6,7 +6,7 @@ require (
|
|||
github.com/88250/clipboard v0.1.5
|
||||
github.com/88250/css v0.1.2
|
||||
github.com/88250/gulu v1.2.3-0.20221007162906-ded80d955178
|
||||
github.com/88250/lute v1.7.5-0.20221012140300-1c6e1cd71a9d
|
||||
github.com/88250/lute v1.7.5-0.20221013130230-5e8f1855d305
|
||||
github.com/88250/pdfcpu v0.3.13
|
||||
github.com/88250/vitess-sqlparser v0.0.0-20210205111146-56a2ded2aba1
|
||||
github.com/ConradIrwin/font v0.0.0-20210318200717-ce8d41cc0732
|
||||
|
|
|
@ -19,6 +19,8 @@ github.com/88250/gulu v1.2.3-0.20221007162906-ded80d955178 h1:+Mvo3MW8qYoXNhLx3b
|
|||
github.com/88250/gulu v1.2.3-0.20221007162906-ded80d955178/go.mod h1:I1qBzsksFL2ciGSuqDE7R3XW4BUMrfDgOvSXEk7FsAI=
|
||||
github.com/88250/lute v1.7.5-0.20221012140300-1c6e1cd71a9d h1:i3MwVFebiIzL9LybwmGi2h1QSAjwN/+vfdEs3HnzkfM=
|
||||
github.com/88250/lute v1.7.5-0.20221012140300-1c6e1cd71a9d/go.mod h1:cEoBGi0zArPqAsp0MdG9SKinvH/xxZZWXU7sRx8vHSA=
|
||||
github.com/88250/lute v1.7.5-0.20221013130230-5e8f1855d305 h1:LEwt13WuHsYgzMhGlIrVBBJYIvVKoAoFFN5ZEcfzf9g=
|
||||
github.com/88250/lute v1.7.5-0.20221013130230-5e8f1855d305/go.mod h1:cEoBGi0zArPqAsp0MdG9SKinvH/xxZZWXU7sRx8vHSA=
|
||||
github.com/88250/pdfcpu v0.3.13 h1:touMWMZkCGalMIbEg9bxYp7rETM+zwb9hXjwhqi4I7Q=
|
||||
github.com/88250/pdfcpu v0.3.13/go.mod h1:S5YT38L/GCjVjmB4PB84PymA1qfopjEhfhTNQilLpv4=
|
||||
github.com/88250/vitess-sqlparser v0.0.0-20210205111146-56a2ded2aba1 h1:48T899JQDwyyRu9yXHePYlPdHtpJfrJEUGBMH3SMBWY=
|
||||
|
|
|
@ -648,19 +648,26 @@ func markReplaceSpan(text string, keywords []string, replacementStart, replaceme
|
|||
}
|
||||
|
||||
for _, k := range keywords {
|
||||
if gulu.Str.IsASCII(k) {
|
||||
if gulu.Str.IsASCII(part) {
|
||||
if part == k {
|
||||
parts[i] = replacementStart + k + replacementEnd
|
||||
tmpPart := part
|
||||
tmpK := k
|
||||
if !Conf.Search.CaseSensitive {
|
||||
tmpPart = strings.ToLower(part)
|
||||
tmpK = strings.ToLower(k)
|
||||
}
|
||||
|
||||
if gulu.Str.IsASCII(tmpK) {
|
||||
if gulu.Str.IsASCII(tmpPart) {
|
||||
if tmpPart == tmpK {
|
||||
parts[i] = replacementStart + part + replacementEnd
|
||||
}
|
||||
} else {
|
||||
if strings.Contains(part, k) {
|
||||
parts[i] = strings.ReplaceAll(part, k, replacementStart+k+replacementEnd)
|
||||
if strings.Contains(tmpPart, tmpK) {
|
||||
parts[i] = search.EncloseHighlighting(part, []string{k}, replacementStart, replacementEnd, Conf.Search.CaseSensitive)
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if strings.Contains(part, k) {
|
||||
parts[i] = strings.ReplaceAll(part, k, replacementStart+k+replacementEnd)
|
||||
if strings.Contains(tmpPart, tmpK) {
|
||||
parts[i] = search.EncloseHighlighting(part, []string{k}, replacementStart, replacementEnd, Conf.Search.CaseSensitive)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -195,7 +195,11 @@ func QueryBlockDefIDsByRefText(refText string, excludeIDs []string) (ret []strin
|
|||
func queryDefIDsByDefText(keyword string, excludeIDs []string) (ret []string) {
|
||||
ret = []string{}
|
||||
notIn := "('" + strings.Join(excludeIDs, "','") + "')"
|
||||
rows, err := query("SELECT DISTINCT(def_block_id) FROM refs WHERE content = ? AND def_block_id NOT IN "+notIn, keyword)
|
||||
q := "SELECT DISTINCT(def_block_id) FROM refs WHERE content LIKE ? AND def_block_id NOT IN " + notIn
|
||||
if caseSensitive {
|
||||
q = "SELECT DISTINCT(def_block_id) FROM refs WHERE content = ? AND def_block_id NOT IN " + notIn
|
||||
}
|
||||
rows, err := query(q, keyword)
|
||||
if nil != err {
|
||||
logging.LogErrorf("sql query failed: %s", err)
|
||||
return
|
||||
|
|
Loading…
Add table
Reference in a new issue