Debugging image links with links in the description.
This commit is contained in:
parent
573c929845
commit
0c45ccb39e
@ -13,7 +13,7 @@ XMLElement >> asSnippetDictionary [
|
||||
XMLElement >> sanitizedContent [
|
||||
| className sanitizedText |
|
||||
className := self attributes at: 'st-class'.
|
||||
((className = 'LeTextSnippet') or: [className = 'LePictureSnippet'])
|
||||
(className = 'LeTextSnippet')
|
||||
ifTrue: [
|
||||
sanitizedText := self contentString.
|
||||
sanitizedText := sanitizedText allButFirst.
|
||||
@ -26,6 +26,24 @@ XMLElement >> sanitizedContent [
|
||||
sanitizedText do: [ :line | joinedText nextPutAll: line; nextPut: Character lf ].
|
||||
sanitizedText := joinedText contents allButLast.
|
||||
].
|
||||
(className = 'LePictureSnippet')
|
||||
ifTrue: [ | linkParser linkParserNodes|
|
||||
linkParser := (PPCommonMarkBlockParser parse: self contentString allButFirst)
|
||||
accept: CMBlockVisitor new.
|
||||
linkParserNodes := linkParser children first children.
|
||||
linkParserNodes size = 1
|
||||
ifTrue: [ sanitizedText := linkParserNodes first label text ]
|
||||
ifFalse: [
|
||||
sanitizedText := '' writeStream.
|
||||
linkParserNodes allButLast do: [:each |
|
||||
each className = 'PPCMText'
|
||||
ifTrue: [ sanitizedText nextPutAll: each text allButFirst ].
|
||||
each className = 'PPCMLink'
|
||||
ifTrue: [ sanitizedText nextPutAll: each printString ]
|
||||
].
|
||||
sanitizedText := sanitizedText contents
|
||||
]
|
||||
].
|
||||
^ sanitizedText
|
||||
|
||||
]
|
||||
|
@ -39,9 +39,8 @@ PPCMLink >> printOn: aStream [
|
||||
super initialize.
|
||||
^ aStream
|
||||
nextPutAll:
|
||||
self label text,
|
||||
' -> ',
|
||||
self destination
|
||||
'[',self label text,']',
|
||||
'(',self destination,')'
|
||||
]
|
||||
|
||||
{ #category : #accessing }
|
||||
|
Loading…
Reference in New Issue
Block a user