Can we put codeblocks in the forum?

11 messages, 1 pages:  1 ↖ Go back to topic list

Score: +3

1. sukil,

Hello,
It seems like some time ago the forum changed its text processing engine and became more like Markdown. For example, we can use headings and markdown links now.

However, it seems that code blocks are not rendered correctly or something. (This may happen with list items not ending correctly too?)

This is a codeblock taken from this post in the Spanish forum:


Case $aNums[0] To $aNums[17]
For $I = 0 To UBound($aNums)
If $idMsg = $aNums[$I] Then
agregar_caracter(";Edit1";, ControlGetText($hGUI, ";";, $aNums[$I]))
EndIf
Next

I've ad hoc inserted a code block in that message, but I think other messages just didn't render the code block, I will edit this if I find any in my posts. Any ideas on why this happens? Thanks!

Score: +2

2. augma ,

are you talking about block quotes
the ones which we navigate by pressing q?

Score: +0

3. sukil,

No, codeblocks. They are used to put code in them. They are rendered in a monospaced font and formatting characters should passthrough. Like this versus this. For some reason the brackets in start some definition list of some kind, which I've never seen in any markdown variant.

(OK that didn't work either, strange)

Score: +1

Last edited by sukil, Aug 3 2022 13:14:48

4. augma ,

SORRY DIDN'T KNOW ABOUT THOSE

Score: -2

5. Nikola,

Hello,
you should be able to start a code block using three backquotes and ignore any markdown processing.
For example:


# this won't be a heading,
## this won't be a second heading,


When I say backquotes, I am referring to the symbol `.

Edit: Trying with your example:


Case $aNums[0] To $aNums[17]
For $I
0 To UBound($aNums)

If $idMsg
$aNums[$I] Then
agregar_caracter(";Edit1";, ControlGetText($hGUI, ";";, $aNums[$I]))
EndIf
Next

Score: +1

Last edited by Nikola, Aug 3 2022 15:35:36

6. sukil,

See message 1 for a counterexample, and message 3 for another with just one backtick.

Score: +2

7. Nikola,

Just edited my post with your example, can you look at the edited post 5 and see if this is what you are trying to achieve?
If not, sorry, I don't really understand. Someone else will hopefully help.

Score: +1

8. sukil,

Thanks for trying to help, but it's not. See my post in the client. Notice the 0 in the line of the for is between brackets, and that after $idMsg in the line of the if there are two equal signs. That should be rendered as-is, not start a definition list.

Score: +1

9. Aminiel,

Hello,

There was indeed a small bug with code blocks, it is now fixed.
Thank you for signaling.

You can make a code block by enclosing it with three backticks.
The text immediately on the right before next line on the opening backticks won't be displayed. It is reserved for language name, if one day syntax coloring is added. For the moment it isn't used.

Definition lists still work as before, with equal signs, like this:


First word = first definition
Second word = Second definition
Third word = third definition

Which gives:

First word = first definition
Second word = Second definition
Third word = third definition

This is a markdown extension of my own.

Score: +2

Last edited by Aminiel, Aug 3 2022 16:39:44

10. sukil,

Thanks for the quick fix! I believe there is still a bug though, see message 3, where the first "this" does appear in consolas but also in italics.

Edit: Another bug:


print(";This is a test";)

The quote is rendered as a quote followed by a semicolon.

Also, maybe remove the first blank line before the rendered codeblock?

Score: +2

Last edited by sukil, Aug 3 2022 17:26:50

11. Exink,

Hey there.

Maybe this has nothing to do with the current topic, but I think you should post a list of formatting commands somewhere, so that we can learn how to use this syntax. Perhaps that won't end being too useful since most of people I know read the forum inside the Windows client and then the format goes unnoticed for most of us, but there would be some people who still are using the web forum. I remember I was diving into the forum to find this syntax because I wanted to insert a link. What do you think of it?

Thanks!

Score: +2

11 messages, 1 pages:  1 ↖ Go back to topic list

Answer to topic

You must be connected in order to be allowed to post

Lost password ? Create account