add mentions

This commit is contained in:
Andrea Maria Piana 2019-12-09 11:22:47 +01:00
parent af599402d0
commit e3ba6c6109
No known key found for this signature in database
GPG Key ID: AA6CCA6DE0E06424
8 changed files with 157 additions and 50 deletions

View File

@ -348,6 +348,21 @@ func (c *StatusTag) MarshalJSON() ([]byte, error) {
return json.Marshal(&c1)
}
type Mention struct {
Leaf
}
func (c *Mention) MarshalJSON() ([]byte, error) {
type MentionJSON struct {
Type string `json:"type"`
Literal string `json:"literal"`
}
var c1 MentionJSON
c1.Literal = string(c.Literal)
c1.Type = "mention"
return json.Marshal(&c1)
}
// Strong represents markdown strong node
type Strong struct {
Leaf

View File

@ -16,6 +16,11 @@ func TestStatusTag(t *testing.T) {
doTestsInlineParam(t, tests, TestParams{})
}
func TestMention(t *testing.T) {
tests := readTestFile2(t, "mentions.test")
doTestsInlineParam(t, tests, TestParams{})
}
func testReferenceOverride(t *testing.T) {
var tests = []string{
"test [ref1][]\n",
@ -77,61 +82,61 @@ func testReferenceOverride(t *testing.T) {
func TestStrong(t *testing.T) {
var tests = []string{
"nothing inline\n",
"[{\"literal\":\"nothing inline\"}]",
"[{\"type\":\"paragraph\",\"children\":[{\"literal\":\"nothing inline\"}]}]",
"simple **inline** test\n",
"[{\"literal\":\"simple \"},{\"type\":\"strong\",\"literal\":\"inline\"},{\"literal\":\" test\"}]",
"[{\"type\":\"paragraph\",\"children\":[{\"literal\":\"simple \"},{\"type\":\"strong\",\"literal\":\"inline\"},{\"literal\":\" test\"}]}]",
"simple ***triple*** test\n",
"[{\"literal\":\"simple \"},{\"type\":\"strong\",\"literal\":\"triple\"},{\"literal\":\" test\"}]",
"[{\"type\":\"paragraph\",\"children\":[{\"literal\":\"simple \"},{\"type\":\"strong\",\"literal\":\"triple\"},{\"literal\":\" test\"}]}]",
"**at the** beginning\n",
"[{\"literal\":\"\"},{\"type\":\"strong\",\"literal\":\"at the\"},{\"literal\":\" beginning\"}]",
"[{\"type\":\"paragraph\",\"children\":[{\"literal\":\"\"},{\"type\":\"strong\",\"literal\":\"at the\"},{\"literal\":\" beginning\"}]}]",
"at the **end**\n",
"[{\"literal\":\"at the \"},{\"type\":\"strong\",\"literal\":\"end\"}]",
"[{\"type\":\"paragraph\",\"children\":[{\"literal\":\"at the \"},{\"type\":\"strong\",\"literal\":\"end\"}]}]",
"**try two** in **one line**\n",
"[{\"literal\":\"\"},{\"type\":\"strong\",\"literal\":\"try two\"},{\"literal\":\" in \"},{\"type\":\"strong\",\"literal\":\"one line\"}]",
"[{\"type\":\"paragraph\",\"children\":[{\"literal\":\"\"},{\"type\":\"strong\",\"literal\":\"try two\"},{\"literal\":\" in \"},{\"type\":\"strong\",\"literal\":\"one line\"}]}]",
"over **two\nlines** test\n",
"[{\"literal\":\"over \"},{\"type\":\"strong\",\"literal\":\"two\\nlines\"},{\"literal\":\" test\"}]",
"[{\"type\":\"paragraph\",\"children\":[{\"literal\":\"over \"},{\"type\":\"strong\",\"literal\":\"two\\nlines\"},{\"literal\":\" test\"}]}]",
"odd **number of** markers** here\n",
"[{\"literal\":\"odd \"},{\"type\":\"strong\",\"literal\":\"number of\"},{\"literal\":\" markers** here\"}]",
"[{\"type\":\"paragraph\",\"children\":[{\"literal\":\"odd \"},{\"type\":\"strong\",\"literal\":\"number of\"},{\"literal\":\" markers** here\"}]}]",
"odd **number\nof** markers** here\n",
"[{\"literal\":\"odd \"},{\"type\":\"strong\",\"literal\":\"number\\nof\"},{\"literal\":\" markers** here\"}]",
"[{\"type\":\"paragraph\",\"children\":[{\"literal\":\"odd \"},{\"type\":\"strong\",\"literal\":\"number\\nof\"},{\"literal\":\" markers** here\"}]}]",
"simple __inline__ test\n",
"[{\"literal\":\"simple \"},{\"type\":\"strong\",\"literal\":\"inline\"},{\"literal\":\" test\"}]",
"[{\"type\":\"paragraph\",\"children\":[{\"literal\":\"simple \"},{\"type\":\"strong\",\"literal\":\"inline\"},{\"literal\":\" test\"}]}]",
"__at the__ beginning\n",
"[{\"literal\":\"\"},{\"type\":\"strong\",\"literal\":\"at the\"},{\"literal\":\" beginning\"}]",
"[{\"type\":\"paragraph\",\"children\":[{\"literal\":\"\"},{\"type\":\"strong\",\"literal\":\"at the\"},{\"literal\":\" beginning\"}]}]",
"at the __end__\n",
"[{\"literal\":\"at the \"},{\"type\":\"strong\",\"literal\":\"end\"}]",
"[{\"type\":\"paragraph\",\"children\":[{\"literal\":\"at the \"},{\"type\":\"strong\",\"literal\":\"end\"}]}]",
"__try two__ in __one line__\n",
"[{\"literal\":\"\"},{\"type\":\"strong\",\"literal\":\"try two\"},{\"literal\":\" in \"},{\"type\":\"strong\",\"literal\":\"one line\"}]",
"[{\"type\":\"paragraph\",\"children\":[{\"literal\":\"\"},{\"type\":\"strong\",\"literal\":\"try two\"},{\"literal\":\" in \"},{\"type\":\"strong\",\"literal\":\"one line\"}]}]",
"over __two\nlines__ test\n",
"[{\"literal\":\"over \"},{\"type\":\"strong\",\"literal\":\"two\\nlines\"},{\"literal\":\" test\"}]",
"[{\"type\":\"paragraph\",\"children\":[{\"literal\":\"over \"},{\"type\":\"strong\",\"literal\":\"two\\nlines\"},{\"literal\":\" test\"}]}]",
"odd __number of__ markers__ here\n",
"[{\"literal\":\"odd \"},{\"type\":\"strong\",\"literal\":\"number of\"},{\"literal\":\" markers__ here\"}]",
"[{\"type\":\"paragraph\",\"children\":[{\"literal\":\"odd \"},{\"type\":\"strong\",\"literal\":\"number of\"},{\"literal\":\" markers__ here\"}]}]",
"odd __number\nof__ markers__ here\n",
"[{\"literal\":\"odd \"},{\"type\":\"strong\",\"literal\":\"number\\nof\"},{\"literal\":\" markers__ here\"}]",
"[{\"type\":\"paragraph\",\"children\":[{\"literal\":\"odd \"},{\"type\":\"strong\",\"literal\":\"number\\nof\"},{\"literal\":\" markers__ here\"}]}]",
"mix of **markers__\n",
"[{\"literal\":\"mix of **markers__\"}]",
"[{\"type\":\"paragraph\",\"children\":[{\"literal\":\"mix of **markers__\"}]}]",
"**`/usr`** : this folder is named `usr`\n",
"[{\"literal\":\"\"},{\"type\":\"strong\",\"literal\":\"`/usr`\"},{\"literal\":\" : this folder is named \"},{\"type\":\"code\",\"literal\":\"usr\"}]",
"[{\"type\":\"paragraph\",\"children\":[{\"literal\":\"\"},{\"type\":\"strong\",\"literal\":\"`/usr`\"},{\"literal\":\" : this folder is named \"},{\"type\":\"code\",\"literal\":\"usr\"}]}]",
"**`/usr`** :\n\n this folder is named `usr`\n",
"[{\"literal\":\"\"},{\"type\":\"strong\",\"literal\":\"`/usr`\"},{\"literal\":\" :\\n\\n this folder is named \"},{\"type\":\"code\",\"literal\":\"usr\"}]",
"[{\"type\":\"paragraph\",\"children\":[{\"literal\":\"\"},{\"type\":\"strong\",\"literal\":\"`/usr`\"},{\"literal\":\" :\"}]},{\"type\":\"paragraph\",\"children\":[{\"literal\":\"this folder is named \"},{\"type\":\"code\",\"literal\":\"usr\"}]}]",
}
doTestsInline(t, tests)
}
@ -139,7 +144,7 @@ func TestStrong(t *testing.T) {
func TestStrongShort(t *testing.T) {
var tests = []string{
"**`/usr`** :\n\n this folder is named `usr`\n",
"[{\"literal\":\"\"},{\"type\":\"strong\",\"literal\":\"`/usr`\"},{\"literal\":\" :\\n\\n this folder is named \"},{\"type\":\"code\",\"literal\":\"usr\"}]",
"[{\"type\":\"paragraph\",\"children\":[{\"literal\":\"\"},{\"type\":\"strong\",\"literal\":\"`/usr`\"},{\"literal\":\" :\"}]},{\"type\":\"paragraph\",\"children\":[{\"literal\":\"this folder is named \"},{\"type\":\"code\",\"literal\":\"usr\"}]}]",
}
doTestsInline(t, tests)

View File

@ -14,12 +14,12 @@ func TestDocument(t *testing.T) {
// This shouldn't panic.
// https://github.com/russross/blackfriday/issues/172
"[]:<",
"[{\"literal\":\"[]:\\u003c\"}]",
"[{\"type\":\"paragraph\",\"children\":[{\"literal\":\"[]:\\u003c\"}]}]",
// This shouldn't panic.
// https://github.com/russross/blackfriday/issues/173
" [",
"[{\"literal\":\"[\"}]",
"[{\"type\":\"paragraph\",\"children\":[{\"literal\":\"[\"}]}]",
}
doTests(t, tests)
}

View File

@ -63,6 +63,41 @@ func (p *Parser) Inline(currBlock ast.Node, data []byte) {
p.nesting--
}
const pkLength = 132
func mention(p *Parser, data []byte, offset int) (int, ast.Node) {
data = data[offset:]
n := len(data)
if n < pkLength+1 {
return 0, nil
}
// need to start with 0x
if data[1] != '0' || data[2] != 'x' {
return 0, nil
}
i := 3
for i < pkLength+1 {
if !isValidPublicKeyChar(data[i]) {
return 0, nil
}
i++
}
// Check there's a space
if n != pkLength+1 && !isValidTerminatingMentionChar(data[pkLength+1]) {
return 0, nil
}
mention := &ast.Mention{}
mention.Literal = data[1 : pkLength+1]
return i, mention
}
func statusTag(p *Parser, data []byte, offset int) (int, ast.Node) {
data = data[offset:]
n := len(data)

View File

@ -143,6 +143,7 @@ func NewWithExtensions(extension Extensions) *Parser {
p.inlineCallback[' '] = maybeLineBreak
p.inlineCallback['*'] = emphasis
p.inlineCallback['#'] = statusTag
p.inlineCallback['@'] = mention
p.inlineCallback['_'] = emphasis
if p.extensions&Strikethrough != 0 {
p.inlineCallback['~'] = emphasis
@ -684,6 +685,14 @@ func isValidStatusTagChar(c byte) bool {
return isAlnum(c) || c == '-'
}
func isValidTerminatingMentionChar(c byte) bool {
return isSpace(c) || c == '.' || c == ',' || c == ':' || c == ';'
}
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'
}
// TODO: this is not used
// Replace tab characters with spaces, aligning to the next TAB_SIZE column.
// always ends output with a newline

View File

@ -1,67 +1,67 @@
nothing inline
+++
[{"literal":"nothing inline"}]
[{"type":"paragraph","children":[{"literal":"nothing inline"}]}]
+++
simple *inline* test
+++
[{"literal":"simple "},{"type":"emph","literal":"inline"},{"literal":" test"}]
[{"type":"paragraph","children":[{"literal":"simple "},{"type":"emph","literal":"inline"},{"literal":" test"}]}]
+++
*at the* beginning
+++
[{"literal":""},{"type":"emph","literal":"at the"},{"literal":" beginning"}]
[{"type":"paragraph","children":[{"literal":""},{"type":"emph","literal":"at the"},{"literal":" beginning"}]}]
+++
at the *end*
+++
[{"literal":"at the "},{"type":"emph","literal":"end"}]
[{"type":"paragraph","children":[{"literal":"at the "},{"type":"emph","literal":"end"}]}]
+++
*try two* in *one line*
+++
[{"literal":""},{"type":"emph","literal":"try two"},{"literal":" in "},{"type":"emph","literal":"one line"}]
[{"type":"paragraph","children":[{"literal":""},{"type":"emph","literal":"try two"},{"literal":" in "},{"type":"emph","literal":"one line"}]}]
+++
over *two\nlines* test
+++
[{"literal":"over "},{"type":"emph","literal":"two\\nlines"},{"literal":" test"}]
[{"type":"paragraph","children":[{"literal":"over "},{"type":"emph","literal":"two\\nlines"},{"literal":" test"}]}]
+++
odd *number of* markers* here
+++
[{"literal":"odd "},{"type":"emph","literal":"number of"},{"literal":" markers* here"}]
[{"type":"paragraph","children":[{"literal":"odd "},{"type":"emph","literal":"number of"},{"literal":" markers* here"}]}]
+++
odd *number\nof* markers* here
+++
[{"literal":"odd "},{"type":"emph","literal":"number\\nof"},{"literal":" markers* here"}]
[{"type":"paragraph","children":[{"literal":"odd "},{"type":"emph","literal":"number\\nof"},{"literal":" markers* here"}]}]
+++
simple _inline_ test
+++
[{"literal":"simple "},{"type":"emph","literal":"inline"},{"literal":" test"}]
[{"type":"paragraph","children":[{"literal":"simple "},{"type":"emph","literal":"inline"},{"literal":" test"}]}]
+++
_at the_ beginning
+++
[{"literal":""},{"type":"emph","literal":"at the"},{"literal":" beginning"}]
[{"type":"paragraph","children":[{"literal":""},{"type":"emph","literal":"at the"},{"literal":" beginning"}]}]
+++
at the _end_
+++
[{"literal":"at the "},{"type":"emph","literal":"end"}]
[{"type":"paragraph","children":[{"literal":"at the "},{"type":"emph","literal":"end"}]}]
+++
_try two_ in _one line_
+++
[{"literal":""},{"type":"emph","literal":"try two"},{"literal":" in "},{"type":"emph","literal":"one line"}]
[{"type":"paragraph","children":[{"literal":""},{"type":"emph","literal":"try two"},{"literal":" in "},{"type":"emph","literal":"one line"}]}]
+++
over _two\nlines_ test
+++
[{"literal":"over "},{"type":"emph","literal":"two\\nlines"},{"literal":" test"}]
[{"type":"paragraph","children":[{"literal":"over "},{"type":"emph","literal":"two\\nlines"},{"literal":" test"}]}]
+++
odd _number of_ markers_ here
+++
[{"literal":"odd "},{"type":"emph","literal":"number of"},{"literal":" markers_ here"}]
[{"type":"paragraph","children":[{"literal":"odd "},{"type":"emph","literal":"number of"},{"literal":" markers_ here"}]}]
+++
odd _number\nof_ markers_ here
+++
[{"literal":"odd "},{"type":"emph","literal":"number\\nof"},{"literal":" markers_ here"}]
[{"type":"paragraph","children":[{"literal":"odd "},{"type":"emph","literal":"number\\nof"},{"literal":" markers_ here"}]}]
+++
mix of *markers_
+++
[{"literal":"mix of *markers_"}]
[{"type":"paragraph","children":[{"literal":"mix of *markers_"}]}]
+++
*What is A\* algorithm?*
+++
[{"literal":""},{"type":"emph","literal":"What is A\\* algorithm?"}]
[{"type":"paragraph","children":[{"literal":""},{"type":"emph","literal":"What is A\\* algorithm?"}]}]

43
testdata/mentions.test vendored Normal file
View File

@ -0,0 +1,43 @@
Valid pk at the end @0x0424a68f89ba5fcd5e0640c1e1f591d561fa4125ca4e2a43592bc4123eca10ce064e522c254bb83079ba404327f6eafc01ec90a1444331fe769d3f3a7f90b0dde1
+++
[{"type":"paragraph","children":[{"literal":"Valid pk at the end "},{"type":"mention","literal":"0x0424a68f89ba5fcd5e0640c1e1f591d561fa4125ca4e2a43592bc4123eca10ce064e522c254bb83079ba404327f6eafc01ec90a1444331fe769d3f3a7f90b0dde1"}]}]
+++
Valid pk comma @0x0424a68f89ba5fcd5e0640c1e1f591d561fa4125ca4e2a43592bc4123eca10ce064e522c254bb83079ba404327f6eafc01ec90a1444331fe769d3f3a7f90b0dde1,
+++
[{"type":"paragraph","children":[{"literal":"Valid pk comma "},{"type":"mention","literal":"0x0424a68f89ba5fcd5e0640c1e1f591d561fa4125ca4e2a43592bc4123eca10ce064e522c254bb83079ba404327f6eafc01ec90a1444331fe769d3f3a7f90b0dde1"},{"literal":","}]}]
+++
Valid pk dot @0x0424a68f89ba5fcd5e0640c1e1f591d561fa4125ca4e2a43592bc4123eca10ce064e522c254bb83079ba404327f6eafc01ec90a1444331fe769d3f3a7f90b0dde1.
+++
[{"type":"paragraph","children":[{"literal":"Valid pk dot "},{"type":"mention","literal":"0x0424a68f89ba5fcd5e0640c1e1f591d561fa4125ca4e2a43592bc4123eca10ce064e522c254bb83079ba404327f6eafc01ec90a1444331fe769d3f3a7f90b0dde1"},{"literal":"."}]}]
+++
Valid pk colon @0x0424a68f89ba5fcd5e0640c1e1f591d561fa4125ca4e2a43592bc4123eca10ce064e522c254bb83079ba404327f6eafc01ec90a1444331fe769d3f3a7f90b0dde1:
+++
[{"type":"paragraph","children":[{"literal":"Valid pk colon "},{"type":"mention","literal":"0x0424a68f89ba5fcd5e0640c1e1f591d561fa4125ca4e2a43592bc4123eca10ce064e522c254bb83079ba404327f6eafc01ec90a1444331fe769d3f3a7f90b0dde1"},{"literal":":"}]}]
+++
Valid pk semi-colon @0x0424a68f89ba5fcd5e0640c1e1f591d561fa4125ca4e2a43592bc4123eca10ce064e522c254bb83079ba404327f6eafc01ec90a1444331fe769d3f3a7f90b0dde1;
+++
[{"type":"paragraph","children":[{"literal":"Valid pk semi-colon "},{"type":"mention","literal":"0x0424a68f89ba5fcd5e0640c1e1f591d561fa4125ca4e2a43592bc4123eca10ce064e522c254bb83079ba404327f6eafc01ec90a1444331fe769d3f3a7f90b0dde1"},{"literal":";"}]}]
+++
@0x0424a68f89ba5fcd5e0640c1e1f591d561fa4125ca4e2a43592bc4123eca10ce064e522c254bb83079ba404327f6eafc01ec90a1444331fe769d3f3a7f90b0dde1 at the beginning
+++
[{"type":"paragraph","children":[{"literal":""},{"type":"mention","literal":"0x0424a68f89ba5fcd5e0640c1e1f591d561fa4125ca4e2a43592bc4123eca10ce064e522c254bb83079ba404327f6eafc01ec90a1444331fe769d3f3a7f90b0dde1"},{"literal":" at the beginning"}]}]
+++
in the middle @0x0424a68f89ba5fcd5e0640c1e1f591d561fa4125ca4e2a43592bc4123eca10ce064e522c254bb83079ba404327f6eafc01ec90a1444331fe769d3f3a7f90b0dde1 middle
+++
[{"type":"paragraph","children":[{"literal":"in the middle "},{"type":"mention","literal":"0x0424a68f89ba5fcd5e0640c1e1f591d561fa4125ca4e2a43592bc4123eca10ce064e522c254bb83079ba404327f6eafc01ec90a1444331fe769d3f3a7f90b0dde1"},{"literal":" middle"}]}]
+++
too short @0x0424a68f89ba5fcd5e0640c1e1f591d561fa4125ca4e2a43592bc4123eca10ce064e522c254bb83079ba404327f6eafc01ec90a1444331fe769d3f3a7f90b0dde
+++
[{"type":"paragraph","children":[{"literal":"too short @0x0424a68f89ba5fcd5e0640c1e1f591d561fa4125ca4e2a43592bc4123eca10ce064e522c254bb83079ba404327f6eafc01ec90a1444331fe769d3f3a7f90b0dde"}]}]
+++
too long @0x0424a68f89ba5fcd5e0640c1e1f591d561fa4125ca4e2a43592bc4123eca10ce064e522c254bb83079ba404327f6eafc01ec90a1444331fe769d3f3a7f90b0ddeee
+++
[{"type":"paragraph","children":[{"literal":"too long @0x0424a68f89ba5fcd5e0640c1e1f591d561fa4125ca4e2a43592bc4123eca10ce064e522c254bb83079ba404327f6eafc01ec90a1444331fe769d3f3a7f90b0ddeee"}]}]
+++
Invalid char @0x0n24a68f89ba5fcd5e0640c1e1f591d561fa4125ca4e2a43592bc4123eca10ce064e522c254bb83079ba404327f6eafc01ec90a1444331fe769d3f3a7f90b0dde1
+++
[{"type":"paragraph","children":[{"literal":"Invalid char @0x0n24a68f89ba5fcd5e0640c1e1f591d561fa4125ca4e2a43592bc4123eca10ce064e522c254bb83079ba404327f6eafc01ec90a1444331fe769d3f3a7f90b0dde1"}]}]
+++
Not starting with 0x @0f0424a68f89ba5fcd5e0640c1e1f591d561fa4125ca4e2a43592bc4123eca10ce064e522c254bb83079ba404327f6eafc01ec90a1444331fe769d3f3a7f90b0dde1
+++
[{"type":"paragraph","children":[{"literal":"Not starting with 0x @0f0424a68f89ba5fcd5e0640c1e1f591d561fa4125ca4e2a43592bc4123eca10ce064e522c254bb83079ba404327f6eafc01ec90a1444331fe769d3f3a7f90b0dde1"}]}]

View File

@ -1,44 +1,44 @@
nothing inline
+++
[{"literal":"nothing inline"}]
[{"type":"paragraph","children":[{"literal":"nothing inline"}]}]
+++
simple #tag test
+++
[{"literal":"simple "},{"type":"status-tag","literal":"tag"},{"literal":" test"}]
[{"type":"paragraph","children":[{"literal":"simple "},{"type":"status-tag","literal":"tag"},{"literal":" test"}]}]
+++
#at-the beginning
+++
[{"literal":""},{"type":"status-tag","literal":"at-the"},{"literal":" beginning"}]
[{"type":"paragraph","children":[{"literal":""},{"type":"status-tag","literal":"at-the"},{"literal":" beginning"}]}]
+++
at the #end
+++
[{"literal":"at the "},{"type":"status-tag","literal":"end"}]
[{"type":"paragraph","children":[{"literal":"at the "},{"type":"status-tag","literal":"end"}]}]
+++
#try-two in #one-line
+++
[{"literal":""},{"type":"status-tag","literal":"try-two"},{"literal":" in "},{"type":"status-tag","literal":"one-line"}]
[{"type":"paragraph","children":[{"literal":""},{"type":"status-tag","literal":"try-two"},{"literal":" in "},{"type":"status-tag","literal":"one-line"}]}]
+++
over #two
lines test
+++
[{"literal":"over "},{"type":"status-tag","literal":"two"},{"literal":"\\nlines test"}]
[{"type":"paragraph","children":[{"literal":"over "},{"type":"status-tag","literal":"two"},{"literal":"\nlines test"}]}]
+++
over two\n#lines test
+++
[{"literal":"over two\\n"},{"type":"status-tag","literal":"lines"},{"literal":" test"}]
[{"type":"paragraph","children":[{"literal":"over two\\n"},{"type":"status-tag","literal":"lines"},{"literal":" test"}]}]
+++
not valid #status_tag
+++
[{"literal":"not valid #status_tag"}]
[{"type":"paragraph","children":[{"literal":"not valid #status_tag"}]}]
+++
another not valid #status?tag
+++
[{"literal":"another not valid #status?tag"}]
[{"type":"paragraph","children":[{"literal":"another not valid #status?tag"}]}]
+++
empty # status-tag
+++
[{"literal":"empty # status-tag"}]
[{"type":"paragraph","children":[{"literal":"empty # status-tag"}]}]
+++
status-tag with #number9
+++
[{"literal":"status-tag with "},{"type":"status-tag","literal":"number9"}]
[{"type":"paragraph","children":[{"literal":"status-tag with "},{"type":"status-tag","literal":"number9"}]}]