pillar-markup / Microdown

Microdown is a cleaned and simpler markdown but with more powerful features such as extensions.
Other
40 stars 31 forks source link

Builder codeBlock: logic should encapsulate newLine #854

Open Ducasse opened 3 months ago

Ducasse commented 3 months ago

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 commented 3 months ago

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)