Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Builder codeBlock: logic should encapsulate newLine #854

Open
Ducasse opened this issue Aug 12, 2024 · 1 comment
Open

Builder codeBlock: logic should encapsulate newLine #854

Ducasse opened this issue Aug 12, 2024 · 1 comment

Comments

@Ducasse
Copy link
Contributor

Ducasse commented Aug 12, 2024

It forces clients to emit newLine

        canvas newLine.
	canvas codeblock: aCodeBlock text firstLineAssociations: parameters associations.

and if they forget then they may generate broken code.

@Ducasse
Copy link
Contributor Author

Ducasse commented Aug 21, 2024

Pay attention to then review all the senders of codeblock:firstLineAssociations:
to remove the preceeeding newLine

testSimpleCodeBlockWithFirstTag
	"```language=Pharo
	Hello
	Pharo
	```"
	| mictext |
	mictext := builder newLine; codeblock: self exampleTextMultipleLines firstLineAssociations: {'language' -> 'Pharo'} ; contents.
	self testWithInitialText: mictext.
	self assert: ('*language*' match: mictext) 

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant