chore: bump markdown (#2726)
This commit is contained in:
parent
54b9b0e8af
commit
05073a9640
2
go.mod
2
go.mod
|
@ -54,7 +54,7 @@ require (
|
|||
github.com/status-im/doubleratchet v3.0.0+incompatible
|
||||
github.com/status-im/go-waku v0.0.0-20220403002242-f1a40fad73c3
|
||||
github.com/status-im/go-waku-rendezvous v0.0.0-20211018070416-a93f3b70c432
|
||||
github.com/status-im/markdown v0.0.0-20210405121740-32e5a5055fb6
|
||||
github.com/status-im/markdown v0.0.0-20220622180305-7ee4aa8bbc3f
|
||||
github.com/status-im/migrate/v4 v4.6.2-status.2
|
||||
github.com/status-im/rendezvous v1.3.5-0.20220406135049-e84f589e197a
|
||||
github.com/status-im/status-go/extkeys v1.1.2
|
||||
|
|
7
go.sum
7
go.sum
|
@ -440,7 +440,6 @@ github.com/dustin/go-humanize v0.0.0-20171111073723-bb3d318650d4/go.mod h1:Htrtb
|
|||
github.com/dustin/go-humanize v0.0.0-20180421182945-02af3965c54e/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk=
|
||||
github.com/dustin/go-humanize v1.0.0 h1:VSnTsYCnlFHaM2/igO1h6X3HA71jcobQuxemgkq4zYo=
|
||||
github.com/dustin/go-humanize v1.0.0/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk=
|
||||
github.com/dvyukov/go-fuzz v0.0.0-20191022152526-8cb203812681/go.mod h1:11Gm+ccJnvAhCNLlf5+cS9KjtbaD5I5zaZpFMsTHWTw=
|
||||
github.com/dvyukov/go-fuzz v0.0.0-20200318091601-be3528f3a813/go.mod h1:11Gm+ccJnvAhCNLlf5+cS9KjtbaD5I5zaZpFMsTHWTw=
|
||||
github.com/eapache/go-resiliency v1.1.0/go.mod h1:kFI+JgMyC7bLPUVY133qvEBtVayf5mFgVsvEsIPBvNs=
|
||||
github.com/eapache/go-xerial-snappy v0.0.0-20180814174437-776d5712da21/go.mod h1:+020luEh2TKB4/GOp8oxxtq0Daoen/Cii55CzbTV6DU=
|
||||
|
@ -1502,8 +1501,8 @@ github.com/status-im/gomoji v1.1.3-0.20220213022530-e5ac4a8732d4/go.mod h1:hmpnZ
|
|||
github.com/status-im/keycard-go v0.0.0-20190316090335-8537d3370df4/go.mod h1:RZLeN1LMWmRsyYjvAu+I6Dm9QmlDaIIt+Y+4Kd7Tp+Q=
|
||||
github.com/status-im/keycard-go v0.0.0-20200402102358-957c09536969 h1:Oo2KZNP70KE0+IUJSidPj/BFS/RXNHmKIJOdckzml2E=
|
||||
github.com/status-im/keycard-go v0.0.0-20200402102358-957c09536969/go.mod h1:RZLeN1LMWmRsyYjvAu+I6Dm9QmlDaIIt+Y+4Kd7Tp+Q=
|
||||
github.com/status-im/markdown v0.0.0-20210405121740-32e5a5055fb6 h1:wSC60c77UymRfRJKvzstqb3PMCs3t8x4luQBi0SCIMQ=
|
||||
github.com/status-im/markdown v0.0.0-20210405121740-32e5a5055fb6/go.mod h1:9yR8woqkJIHs3sf9pEjYvaGfmhsXR1leEMAX6+Z5y+M=
|
||||
github.com/status-im/markdown v0.0.0-20220622180305-7ee4aa8bbc3f h1:uLIn523HVfEAMSL/Y2HXixdg8KjYthDQDjrauwMESEc=
|
||||
github.com/status-im/markdown v0.0.0-20220622180305-7ee4aa8bbc3f/go.mod h1:5rjPyv3KffPNVbFjnsVy0NGj9+JeW40WvXLdxH1VKuE=
|
||||
github.com/status-im/migrate/v4 v4.6.2-status.2 h1:SdC+sMDl/aI7vUlwD2qj2p7KsK4T60IS9z4/rYCCbI8=
|
||||
github.com/status-im/migrate/v4 v4.6.2-status.2/go.mod h1:c/kc90n47GZu/58nnz1OMLTf7uE4Da4gZP5qmU+A/v8=
|
||||
github.com/status-im/rendezvous v1.3.5-0.20220406135049-e84f589e197a h1:ygmvqX9sTlX0Nu3niDcEveTadTGh1/mhTcfRqARmGrY=
|
||||
|
@ -1656,7 +1655,6 @@ go.uber.org/zap v1.19.1/go.mod h1:j3DNczoxDZroyBnOT1L/Q79cfUMGZxlv/9dzN7SM1rI=
|
|||
go.uber.org/zap v1.21.0 h1:WefMeulhovoZ2sYXz7st6K0sLj7bBhpiFaud4r4zST8=
|
||||
go.uber.org/zap v1.21.0/go.mod h1:wjWOCqI0f2ZZrJF/UufIOkiC8ii6tm1iqIsLo76RfJw=
|
||||
go4.org v0.0.0-20180809161055-417644f6feb5/go.mod h1:MkTOUMDaeVYJUOUsaDXIhWPZYa1yOyC1qaOBpL57BhE=
|
||||
golang.org/dl v0.0.0-20190829154251-82a15e2f2ead/go.mod h1:IUMfjQLJQd4UTqG1Z90tenwKoCX93Gn3MAQJMOSBsDQ=
|
||||
golang.org/x/build v0.0.0-20190111050920-041ab4dc3f9d/go.mod h1:OWs+y06UdEOHN4y+MfF/py+xQ/tYqIWW03b70/CG9Rw=
|
||||
golang.org/x/crypto v0.0.0-20170930174604-9419663f5a44/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
|
||||
golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
|
||||
|
@ -1993,7 +1991,6 @@ golang.org/x/tools v0.0.0-20191012152004-8de300cfc20a/go.mod h1:b+2E5dAYhXwXZwtn
|
|||
golang.org/x/tools v0.0.0-20191029041327-9cc4af7d6b2c/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
|
||||
golang.org/x/tools v0.0.0-20191029190741-b9c20aec41a5/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
|
||||
golang.org/x/tools v0.0.0-20191108193012-7d206e10da11/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
|
||||
golang.org/x/tools v0.0.0-20191109212701-97ad0ed33101/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
|
||||
golang.org/x/tools v0.0.0-20191113191852-77e3bb0ad9e7/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
|
||||
golang.org/x/tools v0.0.0-20191115202509-3a792d9c32b2/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
|
||||
golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
|
||||
|
|
|
@ -2,9 +2,12 @@ package parser
|
|||
|
||||
import (
|
||||
"bytes"
|
||||
"encoding/hex"
|
||||
"regexp"
|
||||
"strconv"
|
||||
"strings"
|
||||
|
||||
"github.com/btcsuite/btcutil/base58"
|
||||
"github.com/status-im/markdown/ast"
|
||||
)
|
||||
|
||||
|
@ -64,18 +67,15 @@ func (p *Parser) Inline(currBlock ast.Node, data []byte) {
|
|||
}
|
||||
|
||||
const pkLength = 132
|
||||
const compressedPkPrefixLen = 3
|
||||
|
||||
func mention(p *Parser, data []byte, offset int) (int, ast.Node) {
|
||||
data = data[offset:]
|
||||
n := len(data)
|
||||
|
||||
if n < pkLength+1 {
|
||||
return 0, nil
|
||||
}
|
||||
|
||||
if n >= pkLength+1 {
|
||||
// need to start with 0x
|
||||
if data[1] != '0' || data[2] != 'x' {
|
||||
|
||||
return 0, nil
|
||||
}
|
||||
|
||||
|
@ -96,6 +96,31 @@ func mention(p *Parser, data []byte, offset int) (int, ast.Node) {
|
|||
mention.Literal = data[1 : pkLength+1]
|
||||
|
||||
return i, mention
|
||||
} else if n >= compressedPkPrefixLen+1 {
|
||||
if data[1] != 'z' || data[2] != 'Q' || data[3] != '3' {
|
||||
return 0, nil
|
||||
}
|
||||
|
||||
i := 1
|
||||
for _, c := range data[1:] {
|
||||
if !isValidCompressedPublicKeyChar(c) {
|
||||
break
|
||||
}
|
||||
i++
|
||||
}
|
||||
|
||||
decodedPK := base58.Decode(string(data[2:i]))
|
||||
decodedPKStr := hex.EncodeToString(decodedPK)
|
||||
if !strings.HasPrefix(decodedPKStr, "e701") || len(decodedPKStr) != 70 {
|
||||
return 0, nil
|
||||
}
|
||||
|
||||
mention := &ast.Mention{}
|
||||
mention.Literal = data[1:i]
|
||||
return i, mention
|
||||
}
|
||||
|
||||
return 0, nil
|
||||
}
|
||||
|
||||
func statusTag(p *Parser, data []byte, offset int) (int, ast.Node) {
|
||||
|
|
|
@ -703,6 +703,15 @@ func isValidPublicKeyChar(c byte) bool {
|
|||
return c == '0' || c == '1' || c == '2' || c == '3' || c == '4' || c == '5' || c == '6' || c == '7' || c == '8' || c == '9' || c == 'a' || c == 'b' || c == 'c' || c == 'd' || c == 'e' || c == 'f'
|
||||
}
|
||||
|
||||
func isValidCompressedPublicKeyChar(c byte) bool {
|
||||
return c == '0' || c == '1' || c == '2' || c == '3' || c == '4' || c == '5' || c == '6' || c == '7' || c == '8' || c == '9' ||
|
||||
c == 'a' || c == 'b' || c == 'c' || c == 'd' || c == 'e' || c == 'f' || c == 'g' || c == 'h' || c == 'i' || c == 'j' ||
|
||||
c == 'k' || c == 'm' || c == 'n' || c == 'o' || c == 'p' || c == 'q' || c == 'r' || c == 's' || c == 't' || c == 'u' ||
|
||||
c == 'v' || c == 'w' || c == 'x' || c == 'y' || c == 'z' || c == 'A' || c == 'B' || c == 'C' || c == 'D' || c == 'E' ||
|
||||
c == 'F' || c == 'G' || c == 'H' || c == 'J' || c == 'K' || c == 'L' || c == 'M' || c == 'N' || c == 'P' || c == 'Q' ||
|
||||
c == 'R' || c == 'S' || c == 'T' || c == 'U' || c == 'V' || c == 'W' || c == 'X' || c == 'Y' || c == 'Z'
|
||||
}
|
||||
|
||||
// TODO: this is not used
|
||||
// Replace tab characters with spaces, aligning to the next TAB_SIZE column.
|
||||
// always ends output with a newline
|
||||
|
|
|
@ -959,7 +959,7 @@ github.com/status-im/go-waku-rendezvous/pb
|
|||
# github.com/status-im/keycard-go v0.0.0-20200402102358-957c09536969
|
||||
## explicit
|
||||
github.com/status-im/keycard-go/derivationpath
|
||||
# github.com/status-im/markdown v0.0.0-20210405121740-32e5a5055fb6
|
||||
# github.com/status-im/markdown v0.0.0-20220622180305-7ee4aa8bbc3f
|
||||
## explicit; go 1.12
|
||||
github.com/status-im/markdown
|
||||
github.com/status-im/markdown/ast
|
||||
|
|
Loading…
Reference in New Issue