Arreglando manualmente problema en el baseline.
This commit is contained in:
commit
5ec6ea6377
@ -10,47 +10,44 @@ XMLElement >> asSnippetDictionary [
|
|||||||
]
|
]
|
||||||
|
|
||||||
{ #category : #'*MiniDocs' }
|
{ #category : #'*MiniDocs' }
|
||||||
XMLElement >> sanitizedContent [
|
XMLElement >> extractMarkdownImageLinkData [
|
||||||
| className sanitizedText |
|
| linkParserNodes sanitizedText linkParser |
|
||||||
className := self attributes at: 'st-class'.
|
linkParser := (PPCommonMarkBlockParser parse: (self contentString trimBoth: [:each | each = Character lf]) allButFirst)
|
||||||
(className = 'LeTextSnippet')
|
|
||||||
ifTrue: [
|
|
||||||
sanitizedText := self contentString.
|
|
||||||
sanitizedText := sanitizedText allButFirst.
|
|
||||||
sanitizedText := sanitizedText allButLast.
|
|
||||||
].
|
|
||||||
(className = 'LePharoSnippet') ifTrue: [ | joinedText |
|
|
||||||
sanitizedText := self contentString lines.
|
|
||||||
sanitizedText := sanitizedText copyFrom: 4 to: sanitizedText size -2.
|
|
||||||
joinedText := '' writeStream.
|
|
||||||
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.
|
accept: CMBlockVisitor new.
|
||||||
linkParserNodes := linkParser children first children.
|
linkParserNodes := linkParser children first children.
|
||||||
linkParserNodes size = 1
|
linkParserNodes size = 1
|
||||||
ifTrue: [
|
|
||||||
linkParserNodes first className = 'PPCMLink'
|
|
||||||
ifTrue: [ sanitizedText := linkParserNodes first label text ]
|
ifTrue: [ sanitizedText := linkParserNodes first label text ]
|
||||||
ifFalse: [
|
ifFalse: [ sanitizedText := '' writeStream.
|
||||||
sanitizedText := (linkParserNodes first text splitOn: '](') first.
|
linkParserNodes allButLast
|
||||||
sanitizedText := sanitizedText copyReplaceAll: '![' with: ''
|
do: [ :each |
|
||||||
]
|
|
||||||
]
|
|
||||||
ifFalse: [
|
|
||||||
sanitizedText := '' writeStream.
|
|
||||||
linkParserNodes allButLast do: [:each |
|
|
||||||
each className = 'PPCMText'
|
each className = 'PPCMText'
|
||||||
ifTrue: [ sanitizedText nextPutAll: each text allButFirst ].
|
ifTrue: [ sanitizedText nextPutAll: each text allButFirst ].
|
||||||
each className = 'PPCMLink'
|
each className = 'PPCMLink'
|
||||||
ifTrue: [ sanitizedText nextPutAll: each printString ]
|
ifTrue: [ sanitizedText nextPutAll: each printString ] ].
|
||||||
].
|
sanitizedText := sanitizedText contents ].
|
||||||
sanitizedText := sanitizedText contents
|
^ {sanitizedText . self contentString }
|
||||||
]
|
]
|
||||||
].
|
|
||||||
^ sanitizedText
|
|
||||||
|
|
||||||
|
{ #category : #'*MiniDocs' }
|
||||||
|
XMLElement >> sanitizedContent [
|
||||||
|
| className sanitizedText |
|
||||||
|
className := self attributes at: 'st-class'.
|
||||||
|
className = 'LeTextSnippet'
|
||||||
|
ifTrue: [ sanitizedText := self contentString.
|
||||||
|
sanitizedText := sanitizedText allButFirst.
|
||||||
|
sanitizedText := sanitizedText allButLast ].
|
||||||
|
className = 'LePharoSnippet'
|
||||||
|
ifTrue: [ | joinedText |
|
||||||
|
sanitizedText := self contentString lines.
|
||||||
|
sanitizedText := sanitizedText copyFrom: 4 to: sanitizedText size - 2.
|
||||||
|
joinedText := '' writeStream.
|
||||||
|
sanitizedText
|
||||||
|
do: [ :line |
|
||||||
|
joinedText
|
||||||
|
nextPutAll: line;
|
||||||
|
nextPut: Character lf ].
|
||||||
|
sanitizedText := joinedText contents allButLast ].
|
||||||
|
className = 'LePictureSnippet'
|
||||||
|
ifTrue: [ sanitizedText := self extractMarkdownImageLinkData ].
|
||||||
|
^ sanitizedText
|
||||||
]
|
]
|
||||||
|
Loading…
Reference in New Issue
Block a user