Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions lib/rdoc/markdown.kpeg
Original file line number Diff line number Diff line change
Expand Up @@ -403,6 +403,8 @@
# the note order list for proper display at the end of the document.

def note_for ref
return unless @note_order

@note_order << ref

label = @note_order.length
Expand Down
2 changes: 2 additions & 0 deletions lib/rdoc/markdown.rb
Original file line number Diff line number Diff line change
Expand Up @@ -788,6 +788,8 @@ def note label
# the note order list for proper display at the end of the document.

def note_for ref
return unless @note_order

@note_order << ref

label = @note_order.length
Expand Down
23 changes: 23 additions & 0 deletions test/rdoc/rdoc_markdown_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1002,6 +1002,29 @@ def test_parse_note_inline
assert_equal expected, doc
end

def test_parse_note_invalid_reference
@parser.notes = true

assert_kind_of RDoc::Markup::Document, parse("[[^0]\n")
Comment thread
skatkov marked this conversation as resolved.
end

def test_parse_note_reference_in_reference_label
@parser.notes = true

doc = parse <<~MD
[foo[^1]bar]

[^1]: footnote
MD

expected = doc(
para("[foo{*1}[rdoc-label:foottext-1:footmark-1]bar]"),
rule(1),
para("{^1}[rdoc-label:footmark-1:foottext-1] footnote"))

assert_equal expected, doc
end

def test_parse_note_no_notes
@parser.notes = false

Expand Down
Loading