Improving Markdeep multiline images.

This commit is contained in:
Offray Vladimir Luna Cárdenas 2023-07-09 22:26:09 -05:00
parent 7a7dfa648d
commit 4f849d2e36

View File

@ -2,11 +2,22 @@ Extension { #name : #LePictureSnippet }
{ #category : #'*MiniDocs' }
LePictureSnippet >> asMarkdeep [
| output |
| output curatedCaption captionLines |
captionLines := self caption lines.
(captionLines size = 1)
ifTrue: [ curatedCaption := caption ]
ifFalse: [
curatedCaption := WriteStream on: ''.
curatedCaption nextPutAll: captionLines first.
captionLines allButFirstDo: [:line |
curatedCaption nextPutAll: ' ', line.
curatedCaption := curatedCaption contents.
]
].
output := WriteStream on: ''.
output
nextPutAll: self metadataDiv;
nextPutAll: '![ ', self caption ,' ](', self urlString, ')';
nextPutAll: '![ ', curatedCaption ,' ](', self urlString, ')';
nextPut: Character lf;
nextPutAll: '</div>';
nextPut: Character lf;