@@ -824,6 +824,8 @@ def paragraph parts
824824 def parse markdown
825825 @references = { }
826826 @unlinked_references = { }
827+ @footnotes = nil
828+ @note_order = nil
827829
828830 markdown += "\n \n "
829831
@@ -15478,7 +15480,7 @@ def _Note
1547815480 return _tmp
1547915481 end
1548015482
15481- # InlineNote = &{ notes? } "^[" @StartList:a (!"]" Inline:l { a << l })+ "]" { ref = [:inline, @note_order.length] @footnotes[ref] = paragraph a note_for ref }
15483+ # InlineNote = &{ notes? } "^[" @StartList:a (!"]" Inline:l { a << l })+ "]" { raise ParseError, 'invalid inline note' unless @note_order ref = [:inline, @note_order.length] @footnotes[ref] = paragraph a note_for ref }
1548215484 def _InlineNote
1548315485
1548415486 _save = self . pos
@@ -15569,7 +15571,9 @@ def _InlineNote
1556915571 self . pos = _save
1557015572 break
1557115573 end
15572- @result = begin ; ref = [ :inline , @note_order . length ]
15574+ @result = begin ; raise ParseError , 'invalid inline note' unless @note_order
15575+
15576+ ref = [ :inline , @note_order . length ]
1557315577 @footnotes [ ref ] = paragraph a
1557415578
1557515579 note_for ref
@@ -16843,7 +16847,7 @@ def _DefinitionListDefinition
1684316847 Rules [ :_NoteReference ] = rule_info ( "NoteReference" , "&{ notes? } RawNoteReference:ref { note_for ref }" )
1684416848 Rules [ :_RawNoteReference ] = rule_info ( "RawNoteReference" , "\" [^\" < (!@Newline !\" ]\" .)+ > \" ]\" { text }" )
1684516849 Rules [ :_Note ] = rule_info ( "Note" , "&{ notes? } @NonindentSpace RawNoteReference:ref \" :\" @Sp @StartList:a RawNoteBlock:i { a.concat i } (&Indent RawNoteBlock:i { a.concat i })* { @footnotes[ref] = paragraph a nil }" )
16846- Rules [ :_InlineNote ] = rule_info ( "InlineNote" , "&{ notes? } \" ^[\" @StartList:a (!\" ]\" Inline:l { a << l })+ \" ]\" { ref = [:inline, @note_order.length] @footnotes[ref] = paragraph a note_for ref }" )
16850+ Rules [ :_InlineNote ] = rule_info ( "InlineNote" , "&{ notes? } \" ^[\" @StartList:a (!\" ]\" Inline:l { a << l })+ \" ]\" { raise ParseError, 'invalid inline note' unless @note_order ref = [:inline, @note_order.length] @footnotes[ref] = paragraph a note_for ref }" )
1684716851 Rules [ :_Notes ] = rule_info ( "Notes" , "(Note | SkipBlock)*" )
1684816852 Rules [ :_RawNoteBlock ] = rule_info ( "RawNoteBlock" , "@StartList:a (!@BlankLine !RawNoteReference OptionallyIndentedLine:l { a << l })+ < @BlankLine* > { a << text } { a }" )
1684916853 Rules [ :_CodeFence ] = rule_info ( "CodeFence" , "&{ github? } Ticks3 (@Sp StrChunk:format)? @Sp @Newline? < ((!\" `\" Nonspacechar)+ | !Ticks3 /`+/ | Spacechar | @Newline)+ > Ticks3 @Sp @Newline* { verbatim = RDoc::Markup::Verbatim.new text verbatim.format = format.intern if format.instance_of?(String) verbatim }" )
0 commit comments