Skip to content

Commit 692f03a

Browse files
committed
fix footnote def sourcepos with fix_zero_end_columns.
1 parent 8d902a1 commit 692f03a

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

src/parser/mod.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1686,6 +1686,11 @@ where
16861686
}
16871687
nl.tight = self.determine_list_tight(node);
16881688
}
1689+
NodeValue::FootnoteDefinition(_) => {
1690+
if let Some(candidate_end) = self.fix_zero_end_columns(node) {
1691+
ast.sourcepos.end = candidate_end;
1692+
}
1693+
}
16891694
_ => (),
16901695
}
16911696

src/tests/footnotes.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,7 @@ fn sourcepos() {
269269
(text (5:1-5:36) "Here is a longer footnote reference.")
270270
(footnote_reference (5:37-5:42))
271271
])
272-
(footnote_definition (3:1-4:0) [ // XXX :(
272+
(footnote_definition (3:1-3:27) [
273273
(paragraph (3:7-3:27) [
274274
(text (3:7-3:27) "Here is the footnote.")
275275
])
@@ -299,7 +299,7 @@ fn leave_footnote_definitions() {
299299
(text (1:1-1:29) "Here is a footnote reference.")
300300
(footnote_reference (1:30-1:33))
301301
])
302-
(footnote_definition (3:1-4:0) [ // XXX :(
302+
(footnote_definition (3:1-3:27) [
303303
(paragraph (3:7-3:27) [
304304
(text (3:7-3:27) "Here is the footnote.")
305305
])

0 commit comments

Comments
 (0)