mirror of
https://github.com/status-im/status-go.git
synced 2025-02-18 01:37:22 +00:00
Update markdown module
This commit is contained in:
parent
4ecca1169d
commit
a36144983a
2
go.mod
2
go.mod
@ -51,7 +51,7 @@ require (
|
|||||||
github.com/russolsen/transit v0.0.0-20180705123435-0794b4c4505a
|
github.com/russolsen/transit v0.0.0-20180705123435-0794b4c4505a
|
||||||
github.com/status-im/doubleratchet v3.0.0+incompatible
|
github.com/status-im/doubleratchet v3.0.0+incompatible
|
||||||
github.com/status-im/keycard-go v0.0.0-20200107115650-f38e9a19958e // indirect
|
github.com/status-im/keycard-go v0.0.0-20200107115650-f38e9a19958e // indirect
|
||||||
github.com/status-im/markdown v0.0.0-20200210164614-b9fe92168122
|
github.com/status-im/markdown v0.0.0-20201019100609-fdf2b9595723
|
||||||
github.com/status-im/migrate/v4 v4.6.2-status.2
|
github.com/status-im/migrate/v4 v4.6.2-status.2
|
||||||
github.com/status-im/rendezvous v1.3.0
|
github.com/status-im/rendezvous v1.3.0
|
||||||
github.com/status-im/status-go/extkeys v1.1.2
|
github.com/status-im/status-go/extkeys v1.1.2
|
||||||
|
4
go.sum
4
go.sum
@ -652,8 +652,8 @@ github.com/status-im/keycard-go v0.0.0-20190424133014-d95853db0f48 h1:ju5UTwk5Od
|
|||||||
github.com/status-im/keycard-go v0.0.0-20190424133014-d95853db0f48/go.mod h1:RZLeN1LMWmRsyYjvAu+I6Dm9QmlDaIIt+Y+4Kd7Tp+Q=
|
github.com/status-im/keycard-go v0.0.0-20190424133014-d95853db0f48/go.mod h1:RZLeN1LMWmRsyYjvAu+I6Dm9QmlDaIIt+Y+4Kd7Tp+Q=
|
||||||
github.com/status-im/keycard-go v0.0.0-20200107115650-f38e9a19958e h1:iT/UJdf+SzbgkIPDe/RmlCfLEQ+ab4UMl6toBl9CGZA=
|
github.com/status-im/keycard-go v0.0.0-20200107115650-f38e9a19958e h1:iT/UJdf+SzbgkIPDe/RmlCfLEQ+ab4UMl6toBl9CGZA=
|
||||||
github.com/status-im/keycard-go v0.0.0-20200107115650-f38e9a19958e/go.mod h1:RZLeN1LMWmRsyYjvAu+I6Dm9QmlDaIIt+Y+4Kd7Tp+Q=
|
github.com/status-im/keycard-go v0.0.0-20200107115650-f38e9a19958e/go.mod h1:RZLeN1LMWmRsyYjvAu+I6Dm9QmlDaIIt+Y+4Kd7Tp+Q=
|
||||||
github.com/status-im/markdown v0.0.0-20200210164614-b9fe92168122 h1:q18rWqbHHXZGKPAIuvlb2wAAA3XzlMbkEey2bhKf8GY=
|
github.com/status-im/markdown v0.0.0-20201019100609-fdf2b9595723 h1:knqBM/gX4XxsIpX1clXEl8oMYc5KBcgmdLyZEvMJAMk=
|
||||||
github.com/status-im/markdown v0.0.0-20200210164614-b9fe92168122/go.mod h1:9yR8woqkJIHs3sf9pEjYvaGfmhsXR1leEMAX6+Z5y+M=
|
github.com/status-im/markdown v0.0.0-20201019100609-fdf2b9595723/go.mod h1:9yR8woqkJIHs3sf9pEjYvaGfmhsXR1leEMAX6+Z5y+M=
|
||||||
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 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/migrate/v4 v4.6.2-status.2/go.mod h1:c/kc90n47GZu/58nnz1OMLTf7uE4Da4gZP5qmU+A/v8=
|
||||||
github.com/status-im/rendezvous v1.3.0 h1:7RK/MXXW+tlm0asKm1u7Qp7Yni6AO29a7j8+E4Lbjg4=
|
github.com/status-im/rendezvous v1.3.0 h1:7RK/MXXW+tlm0asKm1u7Qp7Yni6AO29a7j8+E4Lbjg4=
|
||||||
|
33
vendor/github.com/status-im/markdown/ast/node.go
generated
vendored
33
vendor/github.com/status-im/markdown/ast/node.go
generated
vendored
@ -382,11 +382,44 @@ func (c *Strong) MarshalJSON() ([]byte, error) {
|
|||||||
return json.Marshal(&c1)
|
return json.Marshal(&c1)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// StrongEmph represents markdown strong emphasis node
|
||||||
|
type StrongEmph struct {
|
||||||
|
Leaf
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *StrongEmph) MarshalJSON() ([]byte, error) {
|
||||||
|
type StrongJSON struct {
|
||||||
|
Type string `json:"type"`
|
||||||
|
Literal string `json:"literal"`
|
||||||
|
*Attribute
|
||||||
|
}
|
||||||
|
var c1 StrongJSON
|
||||||
|
c1.Literal = string(c.Literal)
|
||||||
|
c1.Attribute = c.Attribute
|
||||||
|
c1.Type = "strong-emph"
|
||||||
|
|
||||||
|
return json.Marshal(&c1)
|
||||||
|
}
|
||||||
|
|
||||||
// Del represents markdown del node
|
// Del represents markdown del node
|
||||||
type Del struct {
|
type Del struct {
|
||||||
Leaf
|
Leaf
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (c *Del) MarshalJSON() ([]byte, error) {
|
||||||
|
type StrongJSON struct {
|
||||||
|
Type string `json:"type"`
|
||||||
|
Literal string `json:"literal"`
|
||||||
|
*Attribute
|
||||||
|
}
|
||||||
|
var c1 StrongJSON
|
||||||
|
c1.Literal = string(c.Literal)
|
||||||
|
c1.Attribute = c.Attribute
|
||||||
|
c1.Type = "del"
|
||||||
|
|
||||||
|
return json.Marshal(&c1)
|
||||||
|
}
|
||||||
|
|
||||||
// Link represents markdown link node
|
// Link represents markdown link node
|
||||||
type Link struct {
|
type Link struct {
|
||||||
Container
|
Container
|
||||||
|
15
vendor/github.com/status-im/markdown/parser/inline.go
generated
vendored
15
vendor/github.com/status-im/markdown/parser/inline.go
generated
vendored
@ -1164,7 +1164,14 @@ func helperEmphasis(p *Parser, data []byte, c byte) (int, ast.Node) {
|
|||||||
|
|
||||||
emph := &ast.Emph{}
|
emph := &ast.Emph{}
|
||||||
emph.Literal = data[:i]
|
emph.Literal = data[:i]
|
||||||
return i + 1, emph
|
var node ast.Node = emph
|
||||||
|
if p.extensions&SuperSubscript == 0 && c == '~' {
|
||||||
|
del := &ast.Del{}
|
||||||
|
del.Literal = data[:i]
|
||||||
|
node = del
|
||||||
|
}
|
||||||
|
|
||||||
|
return i + 1, node
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1217,9 +1224,9 @@ func helperTripleEmphasis(p *Parser, data []byte, offset int, c byte) (int, ast.
|
|||||||
switch {
|
switch {
|
||||||
case i+2 < len(data) && data[i+1] == c && data[i+2] == c:
|
case i+2 < len(data) && data[i+1] == c && data[i+2] == c:
|
||||||
// triple symbol found
|
// triple symbol found
|
||||||
strong := &ast.Strong{}
|
strongEmph := &ast.StrongEmph{}
|
||||||
strong.Literal = data[:i]
|
strongEmph.Literal = data[:i]
|
||||||
return i + 3, strong
|
return i + 3, strongEmph
|
||||||
case i+1 < len(data) && data[i+1] == c:
|
case i+1 < len(data) && data[i+1] == c:
|
||||||
// double symbol found, hand over to emph1
|
// double symbol found, hand over to emph1
|
||||||
length, node := helperEmphasis(p, origData[offset-2:], c)
|
length, node := helperEmphasis(p, origData[offset-2:], c)
|
||||||
|
2
vendor/modules.txt
vendored
2
vendor/modules.txt
vendored
@ -366,7 +366,7 @@ github.com/status-im/doubleratchet
|
|||||||
github.com/status-im/go-multiaddr-ethv4
|
github.com/status-im/go-multiaddr-ethv4
|
||||||
# github.com/status-im/keycard-go v0.0.0-20200107115650-f38e9a19958e
|
# github.com/status-im/keycard-go v0.0.0-20200107115650-f38e9a19958e
|
||||||
github.com/status-im/keycard-go/derivationpath
|
github.com/status-im/keycard-go/derivationpath
|
||||||
# github.com/status-im/markdown v0.0.0-20200210164614-b9fe92168122
|
# github.com/status-im/markdown v0.0.0-20201019100609-fdf2b9595723
|
||||||
github.com/status-im/markdown
|
github.com/status-im/markdown
|
||||||
github.com/status-im/markdown/ast
|
github.com/status-im/markdown/ast
|
||||||
github.com/status-im/markdown/parser
|
github.com/status-im/markdown/parser
|
||||||
|
Loading…
x
Reference in New Issue
Block a user