Fix (fndef) over (footnote) at newline in paragraph
This commit is contained in:
parent
a6fc9d5326
commit
7ff266ef44
3 changed files with 56 additions and 51 deletions
11
grammar.js
11
grammar.js
|
|
@ -1,13 +1,14 @@
|
|||
// Dynamic precedence constants ========================== {{{1
|
||||
DYN = {
|
||||
multiline: -10,
|
||||
tablefm: 1, // over directive
|
||||
tablefm: 1, // over directive
|
||||
paragraphnl: -1,
|
||||
paragraphtext: 1,
|
||||
nonparagraph: 10, // not sure why this needs to be so high
|
||||
nonparagraph: 10, // not sure why this needs to be so high
|
||||
hltags: 1,
|
||||
listtag: 1,
|
||||
conflicts: -1,
|
||||
footnote: 1, // paragraph\nfn -> continued paragraph (footnote) instead of fndef
|
||||
}
|
||||
|
||||
org_grammar = {
|
||||
|
|
@ -369,17 +370,17 @@ org_grammar = {
|
|||
$._fn_label,
|
||||
']',
|
||||
$._paragraph_body,
|
||||
)),
|
||||
)),
|
||||
|
||||
footnote: $ => prec('footnote',
|
||||
seq(
|
||||
prec.dynamic(DYN.footnote, seq(
|
||||
$._fn,
|
||||
choice(
|
||||
$._fn_label,
|
||||
seq(optional($._fn_label), token.immediate(':'), $._paragraph_body),
|
||||
),
|
||||
']',
|
||||
)),
|
||||
))),
|
||||
|
||||
// Directive & Comments================================= {{{1
|
||||
|
||||
|
|
|
|||
|
|
@ -1951,54 +1951,58 @@
|
|||
"type": "PREC",
|
||||
"value": "footnote",
|
||||
"content": {
|
||||
"type": "SEQ",
|
||||
"members": [
|
||||
{
|
||||
"type": "SYMBOL",
|
||||
"name": "_fn"
|
||||
},
|
||||
{
|
||||
"type": "CHOICE",
|
||||
"members": [
|
||||
{
|
||||
"type": "SYMBOL",
|
||||
"name": "_fn_label"
|
||||
},
|
||||
{
|
||||
"type": "SEQ",
|
||||
"members": [
|
||||
{
|
||||
"type": "CHOICE",
|
||||
"members": [
|
||||
{
|
||||
"type": "SYMBOL",
|
||||
"name": "_fn_label"
|
||||
},
|
||||
{
|
||||
"type": "BLANK"
|
||||
"type": "PREC_DYNAMIC",
|
||||
"value": 1,
|
||||
"content": {
|
||||
"type": "SEQ",
|
||||
"members": [
|
||||
{
|
||||
"type": "SYMBOL",
|
||||
"name": "_fn"
|
||||
},
|
||||
{
|
||||
"type": "CHOICE",
|
||||
"members": [
|
||||
{
|
||||
"type": "SYMBOL",
|
||||
"name": "_fn_label"
|
||||
},
|
||||
{
|
||||
"type": "SEQ",
|
||||
"members": [
|
||||
{
|
||||
"type": "CHOICE",
|
||||
"members": [
|
||||
{
|
||||
"type": "SYMBOL",
|
||||
"name": "_fn_label"
|
||||
},
|
||||
{
|
||||
"type": "BLANK"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "IMMEDIATE_TOKEN",
|
||||
"content": {
|
||||
"type": "STRING",
|
||||
"value": ":"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "IMMEDIATE_TOKEN",
|
||||
"content": {
|
||||
"type": "STRING",
|
||||
"value": ":"
|
||||
},
|
||||
{
|
||||
"type": "SYMBOL",
|
||||
"name": "_paragraph_body"
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "SYMBOL",
|
||||
"name": "_paragraph_body"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "STRING",
|
||||
"value": "]"
|
||||
}
|
||||
]
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "STRING",
|
||||
"value": "]"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"_directive_list": {
|
||||
|
|
|
|||
BIN
src/parser.c
BIN
src/parser.c
Binary file not shown.
Loading…
Add table
Reference in a new issue