Fix (fndef) over (footnote) at newline in paragraph

This commit is contained in:
Emilia Simmons 2021-07-19 14:42:39 -04:00
parent a6fc9d5326
commit 7ff266ef44
3 changed files with 56 additions and 51 deletions

View file

@ -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

View file

@ -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": {

Binary file not shown.