Skip to content

Commit

Permalink
Tests for chasing urls bad creation
Browse files Browse the repository at this point in the history
  • Loading branch information
Ducasse committed Mar 23, 2024
1 parent 2d2e543 commit f65afa5
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/Microdown-LaTeXExporter/MicLaTeXWriter.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -229,13 +229,15 @@ MicLaTeXWriter >> visitItalic: anItalic [

{ #category : 'blocks - inline' }
MicLaTeXWriter >> visitLink: aLink [

| reference |
self halt.
reference := aLink fileStringWithoutHostFile.

canvas command
name: 'href';
parameter: reference;
parameter: [ self visitAll: aLink children ].

parameter: aLink url;
parameter: [ self visitAll: aLink children ]
]

{ #category : 'blocks - list' }
Expand Down
24 changes: 24 additions & 0 deletions src/Microdown-Tests/MicLinkBlockTest.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,30 @@ MicLinkBlockTest >> testPrintOn [
self assert: link asString equals: 'Link{ Text(caption) }(http://www.pharo.org)'
]

{ #category : 'tests' }
MicLinkBlockTest >> testTwoUrls [
| lk |
self skip.
lk := (MicInlineParser new parse: '[https://advanced-design-mooc.pharo.org](https://advanced-design-mooc.pharo.org)') first.

self assert: lk bodyString equals: 'https://advanced-design-mooc.pharo.org'.
self assert: lk url equals: 'https://advanced-design-mooc.pharo.org'


]

{ #category : 'tests' }
MicLinkBlockTest >> testTwoUrlsWithMicrodownParser [
| lk |
self skip.
lk := (parser parse: '[https://advanced-design-mooc.pharo.org](https://advanced-design-mooc.pharo.org)') children first children first.

self assert: lk bodyString equals: 'https://advanced-design-mooc.pharo.org'.
self assert: lk url equals: 'https://advanced-design-mooc.pharo.org'


]

{ #category : 'tests' }
MicLinkBlockTest >> testUrl [

Expand Down

0 comments on commit f65afa5

Please sign in to comment.