Improving links detection and tests.

This commit is contained in:
Offray Vladimir Luna Cárdenas 2021-08-16 09:46:14 -05:00
parent a7001f732a
commit d7b7b5ac7e
3 changed files with 20 additions and 0 deletions

View File

@ -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]].'
]

View File

@ -36,6 +36,11 @@ WikiTextGrammar >> linkOpen [
^ '[[' asPParser
]
{ #category : #accessing }
WikiTextGrammar >> linkSea [
^ link sea ==> #second
]
{ #category : #accessing }
WikiTextGrammar >> start [
^ document

View File

@ -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