Arreglando manualmente problema en el baseline.

This commit is contained in:
Offray Vladimir Luna Cárdenas 2024-04-25 12:00:19 -05:00
commit 5ec6ea6377

View File

@ -9,48 +9,45 @@ XMLElement >> asSnippetDictionary [
^ response ^ response
] ]
{ #category : #'*MiniDocs' }
XMLElement >> extractMarkdownImageLinkData [
| linkParserNodes sanitizedText linkParser |
linkParser := (PPCommonMarkBlockParser parse: (self contentString trimBoth: [:each | each = Character lf]) 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 . self contentString }
]
{ #category : #'*MiniDocs' } { #category : #'*MiniDocs' }
XMLElement >> sanitizedContent [ XMLElement >> sanitizedContent [
| className sanitizedText | | className sanitizedText |
className := self attributes at: 'st-class'. className := self attributes at: 'st-class'.
(className = 'LeTextSnippet') className = 'LeTextSnippet'
ifTrue: [ ifTrue: [ sanitizedText := self contentString.
sanitizedText := self contentString. sanitizedText := sanitizedText allButFirst.
sanitizedText := sanitizedText allButFirst. sanitizedText := sanitizedText allButLast ].
sanitizedText := sanitizedText allButLast. className = 'LePharoSnippet'
]. ifTrue: [ | joinedText |
(className = 'LePharoSnippet') ifTrue: [ | joinedText | sanitizedText := self contentString lines.
sanitizedText := self contentString lines. sanitizedText := sanitizedText copyFrom: 4 to: sanitizedText size - 2.
sanitizedText := sanitizedText copyFrom: 4 to: sanitizedText size -2. joinedText := '' writeStream.
joinedText := '' writeStream. sanitizedText
sanitizedText do: [ :line | joinedText nextPutAll: line; nextPut: Character lf ]. do: [ :line |
sanitizedText := joinedText contents allButLast. joinedText
]. nextPutAll: line;
(className = 'LePictureSnippet') nextPut: Character lf ].
ifTrue: [ | linkParser linkParserNodes| sanitizedText := joinedText contents allButLast ].
linkParser := (PPCommonMarkBlockParser parse: self contentString allButFirst) className = 'LePictureSnippet'
accept: CMBlockVisitor new. ifTrue: [ sanitizedText := self extractMarkdownImageLinkData ].
linkParserNodes := linkParser children first children.
linkParserNodes size = 1
ifTrue: [
linkParserNodes first className = 'PPCMLink'
ifTrue: [ sanitizedText := linkParserNodes first label text]
ifFalse: [
sanitizedText := (linkParserNodes first text splitOn: '](') first.
sanitizedText := sanitizedText copyReplaceAll: '![' with: ''
]
]
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 ^ sanitizedText
] ]