Fixing PubPub footnotes conversion

This commit is contained in:
Offray Vladimir Luna Cárdenas 2023-05-10 11:53:54 -05:00
parent 77ddf8a801
commit 7855e9e0c3
1 changed files with 9 additions and 8 deletions

View File

@ -143,14 +143,14 @@ Markdeep >> 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.
currentNoteIndex := footnotesArray indexOf: '[^',footnote, ']: '.
nextNoteIndex := footnotesArray indexOf: '[^',nextFootnote, ']: '.
noteLines := footnotesArray copyFrom: currentNoteIndex to: nextNoteIndex - 1.
response := '' writeStream.
noteLines do: [:line |
line
ifNotEmpty: [ response nextPutAll: line, Character lf ]
ifEmpty: [ response nextPut: '<br>' ]
ifNotEmpty: [ response nextPutAll: line, String lf ]
"ifEmpty: [ response nextPutAll: ' ' ]?"
].
^ response contents
]
@ -438,7 +438,8 @@ Markdeep >> renamePubPubFootnotes [
index := footnotesLines indexOf: replacement.
footnotesLines at: index put: '[^', (footnotesIDs at: i),']: '
].
response := '' writeStream.
^ footnotesLines
"response := '' writeStream.
footnotesIDs allButLast doWithIndex: [:footnote :i |
response
nextPutAll:
@ -447,7 +448,7 @@ Markdeep >> renamePubPubFootnotes [
and: (footnotesIDs at: i + 1)
in: footnotesLines)
].
^ response
^ response"
]
{ #category : #accessing }
@ -459,7 +460,7 @@ Markdeep >> replaceBackslashBreaklines [
{ #category : #accessing }
Markdeep >> replacePubPubFootnotesIdentifiers [
| footnotes sanitized parsedLinks linkIdentifiers footnotesLines |
| footnotes sanitized parsedLinks linkIdentifiers |
footnotes := OrderedDictionary new.
parsedLinks := self pubPubFootnoteRawLinks.
parsedLinks ifEmpty: [ ^self ].