Improving links detection and tests.
This commit is contained in:
parent
a7001f732a
commit
d7b7b5ac7e
@ -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]].'
|
||||
]
|
||||
|
@ -36,6 +36,11 @@ WikiTextGrammar >> linkOpen [
|
||||
^ '[[' asPParser
|
||||
]
|
||||
|
||||
{ #category : #accessing }
|
||||
WikiTextGrammar >> linkSea [
|
||||
^ link sea ==> #second
|
||||
]
|
||||
|
||||
{ #category : #accessing }
|
||||
WikiTextGrammar >> start [
|
||||
^ document
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user