Forum

Thread tagged as: Question, Problem

Prevent wrapping list items in paragraph tags?

Hi, I'm still new to Perch and using markdown in general and I'm wondering why Perch seems to wrap list items in <p> tags and if there is a way I can prevent that without using HTML?

The really strange thing is that is also seems to be wrapping each ordered list item on my page in <p> tags apart from the last one :/

What the result looks like -

perch list wrap

My HTML mark up:

    <div class="col-8-12">
         <article>
            <h1 class="content-title">What does the building offer?</h1>
            <div class="content-box">

                <?php perch_content("About Main Content"); ?>

            </div>
        </article>
    </div>

My markdown in Perch (Text block region):

1. There is a main hall which can accommodate up to 140 people, with professional and robust [Amtico flooring.](https://www.amtico.com "Amtico flooring") There is a choice of either round or rectangular tables for seated events. There is a kitchen adjoining the main hall which is very well equipped and contains sufficient china, cutlery and glassware for 140 place settings.

2. There is a smaller hall which is still spacious and versatile, with carpets and a kitchenette area. This is ideal for meetings and gatherings of up to 50 people.

3. In addition there is a lounge area and a separate IT room which can be hired separately.

Since the hall opened 5 years ago residents of Chartham (and beyond) have had  opportunities to join in a wide variety of activities. These include very well attended weekly Mother and Toddler groups, Bingo, Line Dancing, Hip Hop dance class,  Yoga class,  a Youth Club and Slimming Groups, etc.
Michael Levett

Michael Levett 0 points

  • 6 years ago
Drew McLellan

Drew McLellan 2638 points
Perch Support

Can you show us your template?

Don't worry I solved it! (sort of) Seems like for some reason having a space between list items causes the last child to not be wrapped in a <p> tag. But I'm still not completely sure why it decides to add <p> tags inside a list item in the first place?

Rachel Andrew

Rachel Andrew 394 points
Perch Support

If we can see your template then we can explain.

All seems to be working fine as I said other than the addition of <p> tags in to my <li>. My template for this is very simple, so it may not help, but here it is:

 <article>
            <h1 class="content-title"><perch:content id="heading" type="text" label="Article Heading"/></h1>

            <div class="content-box">

                <perch:content id="content" markdown="true" editor="markitup" type="textarea" label="Main text content" />

            </div>
</article>
Drew McLellan

Drew McLellan 2638 points
Perch Support

You can always test out your Markdown assumptions here: https://parsedown.org/demo

Thanks, that will come in handy.