Starting support for footnotes in the new parser.
This commit is contained in:
parent
fe0d65cf5a
commit
a3741918c9
@ -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:
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user