diff --git a/src/MiniDocs/Markdeep.class.st b/src/MiniDocs/Markdeep.class.st index d60ef7b..b63a23f 100644 --- a/src/MiniDocs/Markdeep.class.st +++ b/src/MiniDocs/Markdeep.class.st @@ -140,6 +140,21 @@ Markdeep >> contents [ ^ output contents. ] +{ #category : #accessing } +Markdeep >> converPubPubFootnoteBetween: footnote and: nextFootnote in: footnotesArray [ + | currentNoteIndex nextNoteIndex response noteLines | + currentNoteIndex := footnotesArray indexOf: footnote, ': '. + nextNoteIndex := footnotesArray indexOf: footnote, ': '. + noteLines := footnotesArray copyFrom: currentNoteIndex to: nextNoteIndex. + response := '' writeStream. + noteLines do: [:line | + line + ifNotEmpty: [ response nextPutAll: line, Character lf ] + ifEmpty: [ response nextPut: '
' ] + ]. + ^ response contents +] + { #category : #utilities } Markdeep >> fontAwesomeHeader [ "I enable the font awesome support in the document header" @@ -411,7 +426,7 @@ Markdeep >> removeCCByLicenseDiv [ { #category : #accessing } Markdeep >> renamePubPubFootnotes [ - | footnotesLines footnotesIDs toReplace | + | footnotesLines footnotesIDs toReplace response | footnotesLines := self contents lines copyFrom: self pubPubFootnotesLinesRange first to: self pubPubFootnotesLinesRange second. @@ -423,8 +438,16 @@ Markdeep >> renamePubPubFootnotes [ index := footnotesLines indexOf: replacement. footnotesLines at: index put: '[^', (footnotesIDs at: i),']: ' ]. - ^ footnotesLines - + response := '' writeStream. + footnotesIDs allButLast doWithIndex: [:footnote :i | + response + nextPutAll: + (self + converPubPubFootnoteBetween: footnote + and: (footnotesIDs at: i + 1) + in: footnotesLines) + ]. + ^ response ] { #category : #accessing }