[markdown] Ignore status tags with upper case letters

related to https://github.com/status-im/status-react/issues/11317
This commit is contained in:
Roman Volosovskyi 2020-10-22 13:36:12 +03:00
parent a36144983a
commit 7467ca7b10
No known key found for this signature in database
GPG Key ID: 0238A4B5ECEE70DE
5 changed files with 16 additions and 6 deletions

View File

@ -1 +1 @@
0.62.12
0.62.13

2
go.mod
View File

@ -51,7 +51,7 @@ require (
github.com/russolsen/transit v0.0.0-20180705123435-0794b4c4505a
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/markdown v0.0.0-20201019100609-fdf2b9595723
github.com/status-im/markdown v0.0.0-20201022101546-c0cbdd5763bf
github.com/status-im/migrate/v4 v4.6.2-status.2
github.com/status-im/rendezvous v1.3.0
github.com/status-im/status-go/extkeys v1.1.2

4
go.sum
View File

@ -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-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/markdown v0.0.0-20201019100609-fdf2b9595723 h1:knqBM/gX4XxsIpX1clXEl8oMYc5KBcgmdLyZEvMJAMk=
github.com/status-im/markdown v0.0.0-20201019100609-fdf2b9595723/go.mod h1:9yR8woqkJIHs3sf9pEjYvaGfmhsXR1leEMAX6+Z5y+M=
github.com/status-im/markdown v0.0.0-20201022101546-c0cbdd5763bf h1:0w1mjNUqEHoL8RkcT4VEZ7+wzqQzAVQXZBFqPElkmJk=
github.com/status-im/markdown v0.0.0-20201022101546-c0cbdd5763bf/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/go.mod h1:c/kc90n47GZu/58nnz1OMLTf7uE4Da4gZP5qmU+A/v8=
github.com/status-im/rendezvous v1.3.0 h1:7RK/MXXW+tlm0asKm1u7Qp7Yni6AO29a7j8+E4Lbjg4=

View File

@ -670,6 +670,11 @@ func isSpace(c byte) bool {
return c == ' ' || c == '\t' || c == '\n' || c == '\r' || c == '\f' || c == '\v'
}
// isLowerCaseLetter returns true if c is ascii lower case letter
func isLowerCaseLetter(c byte) bool {
return (c >= 'a' && c <= 'z')
}
// isLetter returns true if c is ascii letter
func isLetter(c byte) bool {
return (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z')
@ -681,8 +686,13 @@ func isAlnum(c byte) bool {
return (c >= '0' && c <= '9') || isLetter(c)
}
// isNum returns true if c is a digit
func isNum(c byte) bool {
return (c >= '0' && c <= '9')
}
func isValidStatusTagChar(c byte) bool {
return isAlnum(c) || c == '-'
return isNum(c) || isLowerCaseLetter(c) || c == '-'
}
func isValidTerminatingMentionChar(c byte) bool {

2
vendor/modules.txt vendored
View File

@ -366,7 +366,7 @@ github.com/status-im/doubleratchet
github.com/status-im/go-multiaddr-ethv4
# github.com/status-im/keycard-go v0.0.0-20200107115650-f38e9a19958e
github.com/status-im/keycard-go/derivationpath
# github.com/status-im/markdown v0.0.0-20201019100609-fdf2b9595723
# github.com/status-im/markdown v0.0.0-20201022101546-c0cbdd5763bf
github.com/status-im/markdown
github.com/status-im/markdown/ast
github.com/status-im/markdown/parser