Starting support for footnotes in the new parser.

This commit is contained in:
Offray Vladimir Luna Cárdenas 2023-05-09 18:18:39 -05:00
parent fe0d65cf5a
commit a3741918c9
2 changed files with 28 additions and 6 deletions

View File

@ -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:

View File

@ -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