@@ -30,6 +30,12 @@ MicHTMLExporterTest >> factory: aFactory [
3030 factory := aFactory new
3131]
3232
33+ { #category : ' accessing' }
34+ MicHTMLExporterTest >> newLine [
35+
36+ ^ newLine
37+ ]
38+
3339{ #category : ' accessing' }
3440MicHTMLExporterTest >> newLine: aNewLine [
3541 (aNewLine = String cr) ifTrue: [ writer crAsNewLine ].
@@ -39,7 +45,7 @@ MicHTMLExporterTest >> newLine: aNewLine [
3945]
4046
4147{ #category : ' tests - paragraph' }
42- MicHTMLExporterTest >> newLines : aString [
48+ MicHTMLExporterTest >> newLineParagraphAround : aString [
4349
4450 ^ newLine, ' <p>' , aString, ' </p>' , newLine
4551]
@@ -105,7 +111,7 @@ I''m really interested in any topics that evolve Pharo into a better Pharo.
105111{ #category : ' tests - paragraph' }
106112MicHTMLExporterTest >> testAccents [
107113
108- self parse: ' éà' andCheckWeGet: (self newLines :
114+ self parse: ' éà' andCheckWeGet: (self newLineParagraphAround :
109115' éà' )
110116]
111117
@@ -144,7 +150,7 @@ MicHTMLExporterTest >> testFigure [
144150
145151 self
146152 parse: factory figureSample
147- andCheckWeGet: (self newLines :
153+ andCheckWeGet: (self newLineParagraphAround :
148154' <figure><img src="/anUrl" alt="Foo" class="figureTest" width="80"><figcaption>Foo</figcaption></img></figure>' )
149155]
150156
@@ -153,7 +159,7 @@ MicHTMLExporterTest >> testFigureBold [
153159
154160 self
155161 parse: factory figureBoldSample
156- andCheckWeGet: (self newLines :
162+ andCheckWeGet: (self newLineParagraphAround :
157163' <figure><img src="/anUrl" alt="Foo" class="figureTest" width="80"><figcaption><strong>Foo</strong></figcaption></img></figure>' )
158164]
159165
@@ -162,7 +168,7 @@ MicHTMLExporterTest >> testFigureItalic [
162168
163169 self
164170 parse: factory figureItalicSample
165- andCheckWeGet: (self newLines :
171+ andCheckWeGet: (self newLineParagraphAround :
166172' <figure><img src="/anUrl" alt="Foo" class="figureTest" width="80"><figcaption><i>Foo</i></figcaption></img></figure>' )
167173]
168174
@@ -171,7 +177,7 @@ MicHTMLExporterTest >> testFigureNested [
171177
172178 self
173179 parse: factory figureNestedSample
174- andCheckWeGet: (self newLines :
180+ andCheckWeGet: (self newLineParagraphAround :
175181' <figure><img src="/anUrl" alt="Foo_" class="figureTest" width="80"><figcaption><strong>Foo_</strong></figcaption></img></figure>' )
176182]
177183
@@ -180,7 +186,7 @@ MicHTMLExporterTest >> testFigureReal [
180186
181187 self
182188 parse: factory figureRealSample
183- andCheckWeGet: (self newLines :
189+ andCheckWeGet: (self newLineParagraphAround :
184190' <figure><img src="figures/logo.png" alt="A logo png under figures folder" class="figureTest" width="80"><figcaption>A logo png under figures folder</figcaption></img></figure>' )
185191]
186192
@@ -189,7 +195,7 @@ MicHTMLExporterTest >> testFigureStrike [
189195
190196 self
191197 parse: factory figureStrikeSample
192- andCheckWeGet: (self newLines :
198+ andCheckWeGet: (self newLineParagraphAround :
193199' <figure><img src="/anUrl" alt="Foo" class="figureTest" width="80"><figcaption><strike>Foo</strike></figcaption></img></figure>' )
194200]
195201
@@ -198,7 +204,7 @@ MicHTMLExporterTest >> testFigureWithLabelWithoutSize [
198204
199205 self
200206 parse: factory figureWithLabelWithoutSizeSample
201- andCheckWeGet: (self newLines :
207+ andCheckWeGet: (self newLineParagraphAround :
202208' <figure><img src="/anUrl" alt="Foo" class="figureTest"><figcaption>Foo</figcaption></img></figure>' )
203209]
204210
@@ -207,7 +213,7 @@ MicHTMLExporterTest >> testFigureWithoutCaption [
207213
208214 self
209215 parse: factory figureWithoutCaptionSample
210- andCheckWeGet: (self newLines :
216+ andCheckWeGet: (self newLineParagraphAround :
211217' <figure><img src="/anUrl" alt="" class="figureTest" width="80"><figcaption></figcaption></img></figure>' )
212218]
213219
@@ -216,7 +222,7 @@ MicHTMLExporterTest >> testFigureWithoutSizeAndLabel [
216222
217223 self
218224 parse: factory figureSampleWithoutSizeAndLabel
219- andCheckWeGet: (self newLines :
225+ andCheckWeGet: (self newLineParagraphAround :
220226' <figure><img src="/anUrl" alt="Foo"><figcaption>Foo</figcaption></img></figure>' )
221227]
222228
@@ -225,7 +231,7 @@ MicHTMLExporterTest >> testGoutDeFraise [
225231
226232 self
227233 parse: factory figureGoutDeFraise
228- andCheckWeGet: (self newLines :
234+ andCheckWeGet: (self newLineParagraphAround :
229235' <figure><img src="un-gout-de-fraise.jpg" alt="Proposition pour le thème : Un goût de fraise"><figcaption>Proposition pour le thème : <i>Un goût de fraise</i></figcaption></img></figure>' )
230236]
231237
@@ -280,20 +286,20 @@ MicHTMLExporterTest >> testOrderedListIsRecognized [
280286{ #category : ' tests - paragraph' }
281287MicHTMLExporterTest >> testParagraph [
282288
283- self parse: factory paragraphSample andCheckWeGet: (self newLines : ' Foo' )
289+ self parse: factory paragraphSample andCheckWeGet: (self newLineParagraphAround : ' Foo' )
284290]
285291
286292{ #category : ' tests' }
287293MicHTMLExporterTest >> testParagraphLongWithAccents [
288294
289- self parse: factory paragraphOnMultipleLinesSample andCheckWeGet: (self newLines :
295+ self parse: factory paragraphOnMultipleLinesSample andCheckWeGet: (self newLineParagraphAround :
290296' Je ne connais pas la peur, car la peur tue l' ' esprit. La peur est la petite mort qui conduit à l' ' oblitération totale. J' ' affonterai ma peur. Je lui permettrais de passer sur moi, au travers de moi. Et lorsqu' ' elle sera passée, je tournerai mon oeil interieur sur son chemin. Et là où elle sera passée, il n' ' y aura plus rien, rien que moi.' )
291297]
292298
293299{ #category : ' tests - formats' }
294300MicHTMLExporterTest >> testParagraphNestedSample [
295301
296- self parse: factory paragraphNestedSample andCheckWeGet: (self newLines :
302+ self parse: factory paragraphNestedSample andCheckWeGet: (self newLineParagraphAround :
297303' this is a <strong><i>paragraph</i></strong>' )
298304]
299305
@@ -302,21 +308,21 @@ MicHTMLExporterTest >> testParagraphWithBold [
302308
303309 self
304310 parse: factory paragraphBoldSample
305- andCheckWeGet: (self newLines :
311+ andCheckWeGet: (self newLineParagraphAround :
306312' this is a <strong>paragraph</strong>' )
307313]
308314
309315{ #category : ' tests' }
310316MicHTMLExporterTest >> testParagraphWithItalic [
311317
312- self parse: factory paragraphItalicSample andCheckWeGet: (self newLines :
318+ self parse: factory paragraphItalicSample andCheckWeGet: (self newLineParagraphAround :
313319' this is a <i>paragraph</i>' )
314320]
315321
316322{ #category : ' tests - formats' }
317323MicHTMLExporterTest >> testParagraphWithMonospace [
318324
319- self parse: factory paragraphMonospaceSample andCheckWeGet: (self newLines :
325+ self parse: factory paragraphMonospaceSample andCheckWeGet: (self newLineParagraphAround :
320326' this is a <code>paragraph</code>' )
321327]
322328
@@ -338,10 +344,47 @@ MicHTMLExporterTest >> testQuote [
338344 ' <q>Foo</q>'
339345]
340346
347+ { #category : ' tests - raw' }
348+ MicHTMLExporterTest >> testRawOnMultipleLinesIsNotRawButTwoPargraphs [
349+
350+ | mic |
351+ mic := parser
352+ parse: ' some text here!{{ <a class="btn btn-block download" href="https://files.pharo.org/pharo-launcher/mac-arm64"> ' , self newLine,'
353+ <i class="fa fa-apple"></i> macOs arm64</a> }}...and there' .
354+ " notice that I did on purpose that I do not have space around"
355+
356+ self assert: mic children size equals: 2 .
357+ self assert: mic children first class equals: MicParagraphBlock .
358+ self assert: mic children second class equals: MicParagraphBlock .
359+
360+
361+
362+ ]
363+
364+ { #category : ' tests - raw' }
365+ MicHTMLExporterTest >> testRawOnSingleLineShouldNotGoToTheNextLine [
366+
367+ | mic |
368+ mic := parser
369+ parse: ' some text here!{{ <a class="btn btn-block download" href="https://files.pharo.org/pharo-launcher/mac-arm64"> <i class="fa fa-apple"></i> macOs arm64</a> }}...and there' .
370+ " notice that I did on purpose that I do not have space around"
371+
372+ writer visit: mic children first.
373+ self
374+ assert: writer contents
375+ equals:
376+ (
377+ self newLine, ' <p>some text here! <a class="btn btn-block download" href="https://files.pharo.org/pharo-launcher/mac-arm64"> <i class="fa fa-apple"></i> macOs arm64</a> ...and there</p>' , self newLine
378+
379+ )
380+
381+
382+ ]
383+
341384{ #category : ' tests - formats' }
342385MicHTMLExporterTest >> testStrike [
343386
344- self parse: factory strikethroughFormatSample andCheckWeGet: (self newLines :
387+ self parse: factory strikethroughFormatSample andCheckWeGet: (self newLineParagraphAround :
345388' <strike>Foo</strike>' )
346389]
347390
0 commit comments