diff --git a/repository/TiddlyWiki/WikiText.class.st b/repository/TiddlyWiki/WikiText.class.st index d538f40..39c063a 100644 --- a/repository/TiddlyWiki/WikiText.class.st +++ b/repository/TiddlyWiki/WikiText.class.st @@ -43,3 +43,10 @@ WikiText >> convertMarkdownLinks [ ]. ^ self content ] + +{ #category : #accessing } +WikiText >> sample [ + ^ 'The ''quick'' brown ~~flea~~ fox //jumps// over the `lazy` dog. + + This is a link to HelloThere, and one to [[History of TiddlyWiki]] and [[other link]].' +] diff --git a/repository/TiddlyWiki/WikiTextGrammar.class.st b/repository/TiddlyWiki/WikiTextGrammar.class.st index f11b69d..b7a61fb 100644 --- a/repository/TiddlyWiki/WikiTextGrammar.class.st +++ b/repository/TiddlyWiki/WikiTextGrammar.class.st @@ -36,6 +36,11 @@ WikiTextGrammar >> linkOpen [ ^ '[[' asPParser ] +{ #category : #accessing } +WikiTextGrammar >> linkSea [ + ^ link sea ==> #second +] + { #category : #accessing } WikiTextGrammar >> start [ ^ document diff --git a/repository/TiddlyWiki/WikiTextGrammarTest.class.st b/repository/TiddlyWiki/WikiTextGrammarTest.class.st index 8f77ed0..9113c7b 100644 --- a/repository/TiddlyWiki/WikiTextGrammarTest.class.st +++ b/repository/TiddlyWiki/WikiTextGrammarTest.class.st @@ -9,6 +9,14 @@ WikiTextGrammarTest >> parserClass [ ^ WikiTextGrammar ] +{ #category : #accessing } +WikiTextGrammarTest >> testDocument [ + | input | + input := WikiText new sample. + self parse: input rule: #document. + self assert: result size equals: 2 +] + { #category : #accessing } WikiTextGrammarTest >> testLink [ self