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' } { #category : #'*MiniDocs' }
LePictureSnippet >> asMarkdeep [ 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 := WriteStream on: ''.
output output
nextPutAll: self metadataDiv; nextPutAll: self metadataDiv;
nextPutAll: '![ ', self caption ,' ](', self urlString, ')'; nextPutAll: '![ ', curatedCaption ,' ](', self urlString, ')';
nextPut: Character lf; nextPut: Character lf;
nextPutAll: '</div>'; nextPutAll: '</div>';
nextPut: Character lf; nextPut: Character lf;