From f65afa59b6ad16b2a2ff5a513875677a72c6565d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phaneDucasse?= Date: Sat, 23 Mar 2024 21:43:55 +0100 Subject: [PATCH] Tests for chasing urls bad creation --- .../MicLaTeXWriter.class.st | 8 ++++--- src/Microdown-Tests/MicLinkBlockTest.class.st | 24 +++++++++++++++++++ 2 files changed, 29 insertions(+), 3 deletions(-) diff --git a/src/Microdown-LaTeXExporter/MicLaTeXWriter.class.st b/src/Microdown-LaTeXExporter/MicLaTeXWriter.class.st index d16ca481..4cd2d242 100644 --- a/src/Microdown-LaTeXExporter/MicLaTeXWriter.class.st +++ b/src/Microdown-LaTeXExporter/MicLaTeXWriter.class.st @@ -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' } diff --git a/src/Microdown-Tests/MicLinkBlockTest.class.st b/src/Microdown-Tests/MicLinkBlockTest.class.st index 97663f30..7f861b33 100644 --- a/src/Microdown-Tests/MicLinkBlockTest.class.st +++ b/src/Microdown-Tests/MicLinkBlockTest.class.st @@ -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 [