File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 403403 # the note order list for proper display at the end of the document.
404404
405405 def note_for ref
406+ raise ParseError, 'invalid note reference' unless @note_order
407+
406408 @note_order << ref
407409
408410 label = @note_order.length
Original file line number Diff line number Diff line change @@ -788,6 +788,8 @@ def note label
788788 # the note order list for proper display at the end of the document.
789789
790790 def note_for ref
791+ raise ParseError , "invalid note reference: #{ ref } " unless @note_order
792+
791793 @note_order << ref
792794
793795 label = @note_order . length
Original file line number Diff line number Diff line change @@ -1002,6 +1002,14 @@ def test_parse_note_inline
10021002 assert_equal expected , doc
10031003 end
10041004
1005+ def test_parse_note_invalid_reference
1006+ @parser . notes = true
1007+
1008+ assert_raise RDoc ::Markdown ::ParseError do
1009+ parse "[[^0]\n "
1010+ end
1011+ end
1012+
10051013 def test_parse_note_no_notes
10061014 @parser . notes = false
10071015
You can’t perform that action at this time.
0 commit comments