Improving Markdeep multiline images.
This commit is contained in:
parent
7a7dfa648d
commit
4f849d2e36
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user