diff --git a/src/MiniDocs/Markdeep.class.st b/src/MiniDocs/Markdeep.class.st index 26e4c4b..13a02d2 100644 --- a/src/MiniDocs/Markdeep.class.st +++ b/src/MiniDocs/Markdeep.class.st @@ -389,16 +389,15 @@ Markdeep >> pubPubImagesToMarkdeep [ { #category : #accessing } Markdeep >> pubPubRawLinks [ | parser | - parser := PubPubGrammar new document. + parser := PubPubGrammar2 new document. ^ (parser parse: self body) ] { #category : #accessing } Markdeep >> removeAlternativeImagesArray [ - | parser replacements | + | replacements | self body ifNil: [^ self]. - parser := PubPubGrammar2 new. - replacements := parser parse: body. + replacements := self selectPubPubLinksWithSize: 3. replacements ifEmpty: [^self]. replacements do: [:replacement | self body: diff --git a/src/MiniDocs/PubPubGrammar2.class.st b/src/MiniDocs/PubPubGrammar2.class.st index a5014c2..a2a065c 100644 --- a/src/MiniDocs/PubPubGrammar2.class.st +++ b/src/MiniDocs/PubPubGrammar2.class.st @@ -6,14 +6,32 @@ Class { 'imageLink', 'imagesArray', 'imageLocation', - 'document' + 'document', + 'footnote', + 'footnoteLabel', + 'footnoteContent' ], #category : #MiniDocs } { #category : #accessing } PubPubGrammar2 >> document [ - ^ imageLink islandInSea star + ^ (imageLink / footnote) islandInSea star +] + +{ #category : #accessing } +PubPubGrammar2 >> footnote [ + ^ footnoteLabel, footnoteContent +] + +{ #category : #accessing } +PubPubGrammar2 >> footnoteContent [ + ^ '{#' asPParser, #any asPParser starLazy flatten, '}' asPParser ==> #second +] + +{ #category : #accessing } +PubPubGrammar2 >> footnoteLabel [ + ^ '[' asPParser, #any asPParser starLazy flatten, ']' asPParser ==> #second ] { #category : #accessing } @@ -36,6 +54,11 @@ PubPubGrammar2 >> imagesArray [ ^ '{srcset=' asPParser, #any asPParser starLazy flatten, '}' asPParser ==> #second ] +{ #category : #accessing } +PubPubGrammar2 >> imagesContent [ + ^ '{src=' asPParser, #any asPParser starLazy flatten, '}' asPParser ==> #second +] + { #category : #accessing } PubPubGrammar2 >> start [ ^ document