I'm trying to find out which is the smartest way for render some pieces of MySQL queries with Markdown/Macdown editors.
I have tried to apply 4 spaces with ˜˜˜sql
markup before the query code snippet but it seems not working well because it doesn't show code highlights.
See the screenshot below:
Any suggestions? Thanks in advice.
I have tried to apply [four] spaces with
~~~sql
markup before the ... code snippet
In Brief:
~~~
is not enough, ~~~~
is.Longer answer:
You must choose between indented code blocks and fenced code blocks. Partial mixtures of alternative syntaxes won't work.
# Code Block #
What follows is a fenced code block.
Note that all text starts immediately in the left margin.
There is no indentation of the fences.
There are no extra space characters at the start of these lines.
~~~~sql
update employee
set salary = salary * 2
where salary < 100000
~~~~
The following will not work
~~~~sql
update employee
set salary = salary * 2
where salary < 100000
~~~~
You cannot mix indentation and fencing.
The syntax identifiers are part of the fenced code block syntax. You must also end the code block with a line of tildes.
SQL is a supported language for syntax highlighting.
You must also "tick the Enable highlighting in code blocks option." in Macdown.
(Note O.P. Ugol eventually noticed this - see comments. Initially we both overlooked it)
~~~sql
has too few tilde characters, only three
~~~~sql
has the correct number of tilde characters to indicate a "fenced block"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With