Closed svenvanderburg closed 1 year ago
Ah, I guess it is because I have html in my markdown files. I removed the html and now it works. Still I would suggest to improve the error-handling here. Something like: 'You have HTML in your markdown file, we currently do not support this'.
Thank you for the report (especially for including a copy of the error message and pointing to the permanent link to your episode :100:), @svenvanderburg!
This indeed is a bug as it is possible to include HTML in a lesson, but one catch with HTML blocks (especially for <div>
blocks): blank lines stop the interpreter. I will create an issue in {pegboard} (where this originated) to see if I can provide a better error.
The solution is to remove the blank lines (288 and 292) in the <style>
tag
This is coming from {pegboard}, which uses the commonmark 0.29 spec (which is the foundation for pandoc markdown) for parsing documents. HTML blocks are allowed, but as stated in the spec, blank lines signal the end of a block (emphasis mine):
There are two reasons for disallowing [blank lines within HTML blocks] here. First, it removes the need to parse balanced tags, which is expensive and can require backtracking from the end of the document if no matching end tag is found. Second, it provides a very simple and flexible way of including Markdown content inside HTML tags: simply separate the Markdown from the HTML using blank lines [see example 157]...
... The main potential drawback is that one can no longer paste HTML blocks into Markdown documents with 100% reliability. However, in most cases this will work fine, because the blank lines in HTML are usually followed by HTML block tags. [see example 159] There are problems, however, if the inner tags are indented and separated by spaces, as then they will be interpreted as an indented code block [see example 160].
This was the situation your lesson found itself. As you can see in the HTML output of this preview, because of the blank line, the style block is parsed into three separate code blocks:
Output:
<div>
<style scoped>
.dataframe tbody tr th:only-of-type {
vertical-align: middle;
}
.dataframe tbody tr th {
vertical-align: top;
}
.dataframe thead th {
text-align: right;
}
</style>
<table border="1" class="dataframe">
<p>Output:</p>
<div>
<style scoped>
.dataframe tbody tr th:only-of-type {
vertical-align: middle;
}
<pre><code>.dataframe tbody tr th {
vertical-align: top;
}
.dataframe thead th {
text-align: right;
}
</code></pre>
</style>
<table border="1" class="dataframe">
OK, that clarifies! Thanks @zkamvar :pray:
I will close this because I assume it was fixed, but feel free to open if you feel otherwise.
When building a website using this template, I get the following error message:
See github action logs
Here is the file that I am trying to render. Locally it sometimes builds successfully, and sometimes I get the same error, I haven't figured out in which cases it is successful.
What could it be? And maybe it would be nice to add a more user-friendly error message.