Closed MScalopez closed 1 year ago
I'm not quite sure what you are actually using to convert your Markdown document to HTML. It seems you are using kramdown with the GFM parser and HTML converter. If so, the output is expected since you don't use the correct amount of indentation:
1. This item uses *3* spaces for indentation
But the code block uses four spaces
of indentation
~~~
Now with correct indentation
But the code block uses four spaces
of indentation
Output:
<ol>
<li>
<p>This item uses <em>3</em> spaces for indentation</p>
<pre><code> But the code block uses four spaces
of indentation
</code></pre>
</li>
<li>
<p>Now with correct indentation</p>
<pre><code>But the code block uses four spaces
of indentation
</code></pre>
</li>
</ol>
Make sure you indent the code block the right amount of spaces.
Any chance you can point me to the documentation that indicates to use 3 spaces for indentations, so I can send it to my team?
Sure, see the syntax documentation for lists. Generally, you need to indent to the column of the first non-whitespace character in the line after the list item marker. Since you are using 1. something
, the 's' of 'something' is in the fourth column, so three spaces of indentation are needed.
Interesting, thank you for your help.
The following issue was reported to us in a lab we deployed a few weeks ago: https://github.com/MicrosoftLearning/mslearn-fabric/issues/26. The user was complaining that the code segments were adding a leading space to each line of the code segments. When we looked at the Mark Down code, we do not see those extra spaces (look at the example below from https://raw.githubusercontent.com/MicrosoftLearning/mslearn-fabric/main/Instructions/Labs/02-analyze-spark.md).
Let's pay attention to the beginning of the HTML code, for the 'code section'
Note how when the markdown was coverted to HTML it added a space after the "
" and the "df = spark".
Notice below, that there is a space added at the beginning of each line in the code segment
To make it easier to see the issue, just select the copy button, open notepad, and paste it there, it will look like this (without the 0123456789).
You should see that when kramdown is converting Markdown to HTML, and you have a code segment that is indented, it will add an additional space at the beginning of every line in the code. Note that this did not happen in the past.