Skip to content

Commit

Permalink
add test for cycles, but ignored because of #188
Browse files Browse the repository at this point in the history
  • Loading branch information
yshavit committed Aug 26, 2024
1 parent c00176c commit 62dae9e
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/fmt_md_inlines.rs
Original file line number Diff line number Diff line change
Expand Up @@ -178,8 +178,8 @@ impl<'md> MdInlinesWriter<'md> {
fn add_footnote(&mut self, label: &'md String, text: &'md Vec<MdElem>) {
if self.seen_footnotes.insert(label) {
self.pending_references.footnotes.insert(label, text);
self.find_references_in_footnote_elems(text);
}
self.find_references_in_footnote_elems(text);
}

/// Searches the footnote's text to find any link references and additional footnotes.
Expand Down
16 changes: 16 additions & 0 deletions tests/md_cases/footnotes_in_footnotes.toml
Original file line number Diff line number Diff line change
Expand Up @@ -86,3 +86,19 @@ output = '''
}
}
'''


[expect."cyclic reference does't cause infinite loop"]
ignored = true # #188
# When ready to add this back in, add the following to the input markdown:
#
# - DDD: footnote contains cycle[^cycle]
#
# [^cycle]: this footnote references itself[^cycle]
#
cli_args = ['- DDD | P: *']
output = '''
- DDD: footnote contains cycle[^cycle]
[^cycle]: this footnote references itself[^cycle]
'''

0 comments on commit 62dae9e

Please sign in to comment.