Support for detecting PubPub image links.

This commit is contained in:
Offray Vladimir Luna Cárdenas 2022-10-25 08:31:45 -05:00
parent 0d28f0c9f5
commit 381257e55c
2 changed files with 19 additions and 9 deletions

View File

@ -331,9 +331,7 @@ node-type= '.
{ #category : #accessing }
Markdeep >> pubPubFootnoteRawLinks [
| parser |
parser := PubPubGrammar new linkSea star.
^ parser parse: self body
^ self selectPubPubLinksWithSize: 2
]
{ #category : #accessing }
@ -394,6 +392,18 @@ Markdeep >> pubPubFootnotesToMarkdeep [
self body: (sanitized copyReplaceAll: self pubPubFootnotesText with: cleanedFootnotesText contents)
]
{ #category : #accessing }
Markdeep >> pubPubImageLinks [
^ self selectPubPubLinksWithSize: 3
]
{ #category : #accessing }
Markdeep >> pubPubRawLinks [
| parser |
parser := PubPubGrammar new document.
^ (parser parse: self body)
]
{ #category : #accessing }
Markdeep >> replaceBackslashBreaklines [
self bodyReplaceAll: '\
@ -401,6 +411,11 @@ Markdeep >> replaceBackslashBreaklines [
'
]
{ #category : #accessing }
Markdeep >> selectPubPubLinksWithSize: naturalNumber [
^ self pubPubRawLinks select: [ :each | each size = naturalNumber ]
]
{ #category : #accessing }
Markdeep >> tail [
"I enable the document tail, which, in turn, enables a Markdeep document"

View File

@ -21,12 +21,7 @@ PubPubGrammar >> alternativeImages [
{ #category : #accessing }
PubPubGrammar >> document [
^ link islandInSea star
]
{ #category : #accessing }
PubPubGrammar >> element [
^ (link / imageLink) star
^ (link / imageLink ) islandInSea star
]
{ #category : #links }