Partials get wrapped in <p> tags #1335
Unanswered
nathlaroche
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
We are using a mix of partials, custom helpers, and variables to produce single-source documentation with Slate. My markdown file has content like this:
It outputs the expected content: according to the variables we set in the config.rb file, the correct markdown content is included and converted to HTML.
The issue we are having is that the content in the partial is wrapped in a paragraph tag when converted to HTML. This happens because the markdown parser sees the ERB code segment as a paragraph, according to its logic.
For example, assuming that the snippet-prodA.md partial has the following content:
# This is my heading
This is some text.
This will be output in HTML as follows:
This extra paragraph tag is creating havoc on our formatting. I first posted this issue in the middleman forum. One of the suggestions was to create a div tag, so that the markdown parser does not change it to a paragraph. We tried this. While it solved the issue of not adding a paragraph tag, the output looks weird, no matter how we set the div. It seems that the issue we are having with using divs is that it messes up floating, which is used in a specific way in Slate.
For example, it looks something like this (in this example, Step:1 Connect is imported through a partial):
Has anyone ever encountered this? Any ideas on how to solve this?
Thanks!
Nathalie
Beta Was this translation helpful? Give feedback.
All reactions