Minimal detection of PubPub footnote links.

This commit is contained in:
Offray Vladimir Luna Cárdenas 2022-10-21 21:05:40 -05:00
parent 70a06b2c4d
commit 162d126aeb

View File

@ -17,21 +17,17 @@ PubPubGrammar >> document [
{ #category : #links } { #category : #links }
PubPubGrammar >> link [ PubPubGrammar >> link [
^ linkLabel, linkContent ==> #second ^ linkLabel, linkContent
] ]
{ #category : #links } { #category : #links }
PubPubGrammar >> linkContent [ PubPubGrammar >> linkContent [
| content | ^ '{' asPParser, #any asPParser starLazy flatten, '}' asPParser ==> #second.
content := ($} asPParser not) star flatten.
^ ${ asPParser, content, $} asPParser
] ]
{ #category : #links } { #category : #links }
PubPubGrammar >> linkLabel [ PubPubGrammar >> linkLabel [
| label | ^ $[ asPParser, #any asPParser starLazy flatten, $] asPParser ==> #second.
label := ($] asPParser not) star flatten.
^ $[ asPParser, label, $] asPParser
] ]
{ #category : #accessing } { #category : #accessing }