Backstory time: The rendering engine that RapidWeaver, and in turn Stacks, uses for Styled Text does not generate proper semantic code. This isn’t a knock on either, it is just a fact. And it has been this way for a very long time. It is a tricky situation for both RapidWeaver and Stacks as they risk breaking things to change it.
This rendering engine is what Foundry 2 used previously, with a few hacks to make the code slightly better, but still not correct. If you add a Text tool that comes with the Stacks plugin, which uses this Styled Text rendering engine, to a page and then look at the code it generates, you’ll see something like this:
<div id="stacks_in_1" class="">
<div id="stacks_out_2" class="stacks_out">
<div id="stacks_in_2" class="stacks_in text_stack">Lorem ipsum dolor sit amet, sapien platea morbi dolor lacus nunc, nunc ullamcorper. Felis aliquet egestas vitae, nibh ante quis quis dolor sed mauris. Erat lectus sem ut lobortis, adipiscing ligula eleifend, sodales fringilla mattis dui nullam. Ac massa aliquet.</div>
</div>
</div>
Note that there are no paragraph tags used at all and if we add a second paragraph of text within that same default Text tool you’ll get this:
<div id="stacks_in_1" class="">
<div id="stacks_out_2" class="stacks_out">
<div id="stacks_in_2" class="stacks_in text_stack">Lorem ipsum dolor sit amet, sapien platea morbi dolor lacus nunc, nunc ullamcorper. Felis aliquet egestas vitae, nibh ante quis quis dolor sed mauris. Erat lectus sem ut lobortis, adipiscing ligula eleifend, sodales fringilla mattis dui nullam. Ac massa aliquet.<br><br>Lorem ipsum dolor sit amet, sapien platea morbi dolor lacus nunc, nunc ullamcorper. Felis aliquet egestas vitae, nibh ante quis quis dolor sed mauris. Erat lectus sem ut lobortis, adipiscing ligula eleifend, sodales fringilla mattis dui nullam. Ac massa aliquet.</div>
</div>
</div>
Instead of paragraph tags <p>
to separate the two blocks of text it inserts two <br>
break tags instead. This is not proper semantic HTML markup.
Foundry 3: With that back story out of the way, let’s jump forward and look at Foundry 3’s Paragraph tool. The F3 Paragraph tool uses RapidWeaver’s, and in turn Stacks’, Markdown rendering engine, as it does in fact produce proper semantic code, which was a goal of this Foundry 3 re-write. Let’s take a look at what the F3 Paragraph tool produces below. I’ve added two blocks of text into one Foundry 3 Paragraph tool, and this is the resultant output:
<p>Lorem ipsum dolor sit amet,consectetur adipiscin elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco commodo consequat. Duis aute irure dolor in reprehenderit in fugiat nulla pariatur. Excepteur sint occaecat non proident, sunt officia deserunt mollit anim id est laborum.</p>
<p>Lorem ipsum dolor sit amet,consectetur adipiscin elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco commodo consequat. Duis aute irure dolor in reprehenderit in fugiat nulla pariatur. Excepteur sint occaecat non proident, sunt officia deserunt mollit anim id est laborum.</p>
You’ll notice the text is properly wrapped in <p>
tags, unlike the Styled Text rendering engine, and instead of just putting <br>
breaks produce empty lines to create line spacing between blocks of text, a new set of <p>
tags is used for the subsequent paragraphs. This is properly semantic HTML markup.
So where’s the problem here? Many users have grown accustomed to using the Styled Text Engine in RapidWeaver & Stacks, and the Stacks text editing for that engine provides buttons for bold, italic, underline and more, as well as provides a link picker dialogue box for adding links so you can more easily pick internal pages, or external URLs.
The Stacks editor for Markdown however is lacking some of these features. I don’t have control over this unfortunately. So it is a very tricky spot. I either provide customers with a tool that creates the best code for their website but offers a slight learning curve and adaptation period, or provide them with a tool that has a better interface inside the Stacks editor and you end up with lesser code for your site. I chose the former when writing Foundry 3 as I felt it the more beneficial for users.
If you all want a Styled Text based Paragraph tool I can write that and integrate it into Foundry 3 when the influx of support generated by the Foundry 3 launch dies down. But please know that it will not produce proper semantic code.