Microdown icon indicating copy to clipboard operation
Microdown copied to clipboard

MicRealDumper is broken

Open kasperosterbye opened this issue 3 years ago • 3 comments

It is so bad I am wondering to leave it and its test out. It is not broken beyond repair, but it is unclear if it will be used?

Example:

(MicRealDumper new visit: (Microdown parse: '**aaa_bbb_ccc**')) contents

gives:

'(MicParagraphBlock new textElements: {(MicBoldFormatBlock new textElement: (MicTextBlock new substring: ''aaa''))})'

Which is quite wrong!

visitBold: aMicBold
	stream nextPut: $(.
	self emitClassNameOf: aMicBold.
	stream space.
	stream
		nextPutAll: 'new';
		space.
	stream nextPutAll: 'textElement: '.
	aMicBold children first accept: self.
	stream nextPut: $)

second last line visits only first line.

An other example is

visitLink: aMicLink
	stream nextPut: $(.
	self emitClassNameOf: aMicLink.
	stream space.
	stream
		nextPutAll: 'new';
		space.
	stream nextPutAll: 'textElement: '.
	stream nextPut: $[.
	stream nextPutAll: aMicLink substring.
	stream nextPut: $].
	stream nextPut: $(.
	stream nextPutAll: aMicLink url.
	stream nextPut: $)

where the link should be done by traversing the children.

kasperosterbye avatar Oct 02 '22 13:10 kasperosterbye

This is a nice functionality when you debug, but this is the only topic I found for a not so good student.

Ducasse avatar Oct 02 '22 15:10 Ducasse

I will let it to fix as a warmup for some people but yes I share your feelings.

Ducasse avatar Oct 02 '22 15:10 Ducasse

Working on it with bastien

Ducasse avatar Oct 25 '22 13:10 Ducasse