Skip to content

Conversation

miekg
Copy link
Collaborator

@miekg miekg commented Oct 6, 2018

Fix the infinite loop when there is a self-refer footnote by checking if
the reference is already added into parser.notes.

It also fixes of creating duplicate footnotes through this modification.

Add coresponding testcase.

Original PR: russross/blackfriday#366
Fixes: mmarkdown/mmark#25

Signed-off-by: Miek Gieben miek@miek.nl

Fix the infinite loop when there is a self-refer footnote by checking if
the reference is already added into parser.notes.

It also fixes of creating duplicate footnotes through this modification.

Add coresponding testcase.

Original PR: russross/blackfriday#366
Fixes: mmarkdown/mmark#25

Signed-off-by: Miek Gieben <miek@miek.nl>
@miekg miekg requested a review from kjk October 6, 2018 15:41
@miekg
Copy link
Collaborator Author

miekg commented Oct 6, 2018

porting the test cases proved too tedious so I just took what the test wanted to see; at least the test didn't hang is it did before this fix.

@codecov
Copy link

codecov bot commented Oct 6, 2018

Codecov Report

Merging #111 into master will increase coverage by 0.02%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #111      +/-   ##
==========================================
+ Coverage   81.69%   81.72%   +0.02%     
==========================================
  Files          21       21              
  Lines        3737     3743       +6     
==========================================
+ Hits         3053     3059       +6     
  Misses        537      537              
  Partials      147      147
Impacted Files Coverage Δ
parser/parser.go 78.65% <100%> (+0.24%) ⬆️
parser/inline.go 80.6% <100%> (+0.05%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update a822914...a75d668. Read the comment docs.

@kjk
Copy link
Contributor

kjk commented Oct 6, 2018

looks good

@miekg miekg merged commit 78aff1e into gomarkdown:master Oct 7, 2018
@miekg miekg deleted the duplicate-footnotes branch October 7, 2018 07:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support duplicate footnotes
2 participants