- This topic has 54 replies, 9 voices, and was last updated 2 years, 3 months ago by Tom.
March 22, 2019 at 10:11 am #846785Anthony
thanks haha!March 22, 2019 at 10:52 am #846817TomLead DeveloperLead Developer
I believe that’s happening because your HTML is invalid. For example,
<a>elements can’t be wrapped around block elements like a
I ran some tests to compare.
Regular Classic Editor (no Sections): https://www.screencast.com/t/qo6jzJmDM1k
The WordPress editor has always stripped invalid HTML. Sometimes that’s a good thing, and sometimes it’s annoying. One of the things I like about Gutenberg is you can use the HTML block without losing your HTML (even if it is invalid).March 22, 2019 at 11:01 am #846831Anthony
I’ll swap some stuff around and see if that does the trick. Thanks so much for your time!March 22, 2019 at 12:19 pm #846887Paul
Anthony, FYI you can use the free tool at useloom(dot)com (Chrome browser only) to record your screen for stuff like this. It’s very handy!March 22, 2019 at 3:04 pm #846994TomLead DeveloperLead DeveloperMarch 23, 2019 at 3:43 pm #847779Anthony
Can you help me with why the <p> tags are being stripped in this code? It could be I’m writing the code wrong again but it looks right to me.
<h3>Beets & Beet Juice </h3> <img class="alignleft" style="padding: 10px;" src="https://www.cukebook.org/wp-content/uploads/2019/03/beets-thumb.jpg" style="padding: 10px;" /> <p>Growing up I was always told that beets are good for me but I never listens because they didn't taste yummy to me at the time.</p> <p>Beets have among the highest <a href="https://en.wikipedia.org/wiki/Nitrate">nitrate</a> contents of all vegetables. Studies have shown that consuming foods that are high in nitrates help the body create more <a href="https://en.wikipedia.org/wiki/Nitric_oxide">nitric oxide</a>. Nitric oxide is said to help open your blood vessels and help lower blood pressure. One study also showed that nitrates present in beetroot juice lowered blood pressure within just 24 hours.</p> <p>Another study which was done in 2015 found that people with high blood pressure saw it reduced when they consumed 250ml of beet juice every day for four weeks. </p> <strong>Note:</strong>Blood nitrate levels remain elevated for about six hours after eating dietary nitrate. Therefore, beets only have a temporary effect on blood pressure, and regular consumption is required to experience long-term reductions in blood pressure .  <div style="background: #eeeeee; padding: 20px 20px 20px 20px; border-left: 4px solid #7DA92A; margin: 20px 0px 20px 0px;"> <strong style="color: #7da92a; margin-bottom: 10px;">Quick Facts:</strong> <p style="margin-bottom: 0px;">Beets are loaded with vitamins and minerals and low in calories and fat. They also contain inorganic nitrates and pigments, both of which have a number of health benefits.</p> </div> <p>You can juice your own beets or simply cook and eat the whole root. Beetroot is delicious when roasted or added to stir-fries and stews. You can also bake them into chips. Be careful when handling beets — the juice can stain your hands and clothes.</p> <p>Try making your own carrot, apple, ginger, and beet juice for high blood pressure.</p> <button class="accordion"><img style="margin: 0px 10px 12px 0px;" src="https://www.cukebook.org/wp-content/uploads/2019/03/nutrition-icon.png" align="middle" />Nutrition Facts</button> <div class="panel"> <p>Amount Per 1 cup (136g | % Daily Value*</p> <ul> <li><strong>Calories</strong> 59</li> <li><strong>Total Fat:</strong> 0.2 g - 0%</li> <li><strong>Saturated fa:t</strong> 0 g - 0%</li> <li><strong>Polyunsaturated fat:</strong> 0.1 g</li> <li><strong>Monounsaturated fat:</strong> 0 g</li> <li><strong>Cholesterol:</strong> 0mg - 0%</li> <li><strong>Sodium:</strong> 106mg - 4%</li> <li><strong>Potassium:</strong> 442mg - 12%</li> <li><strong>Total Carbohydrate:</strong> 13 g - 4%</li> <li><strong>Dietary fiber:</strong> 3.8g - 15%</li> <li><strong>Sugar:</strong> 9g</li> <li><strong>Protein:</strong> 2.2g - 4%</li> <li><strong>Vitamin A:</strong> 0%</li> <li><strong>Vitamin C:</strong> 11%</li> <li><strong>Calcium:</strong> 2%</li> <li><strong>Iron:</strong> 6%</li> <li><strong>Vitamin D:</strong> 0%</li> <li><strong>Vitamin B-6:</strong> 5%</li> <li><strong>Cobalamin:</strong> 0%</li> <li><strong>Magnesium:</strong> 7%</li> </ul> <p>*Percent Daily Values are based on a 2,000 calorie diet. Your daily values may be higher or lower depending on your calorie needs.</p> </div> <h4>Other benefits of eating beets</h4> <ul> <li>Can Improve Athletic Performance</li> <li>May Help Fight Inflammation</li> <li>May Improve Digestive Health</li> <li>May Help Support Brain Health</li> <li>May Have Some Anti-Cancer Properties</li> <li>May Help You Lose Weight</li> </ul>
When I head from Test > Visual Editor and back to Text it’s stripping the <p> tagsMarch 23, 2019 at 4:41 pm #847827TomLead DeveloperLead DeveloperMarch 23, 2019 at 4:42 pm #847828Anthony
1.7.8March 23, 2019 at 4:45 pm #847831TomLead DeveloperLead DeveloperMarch 23, 2019 at 4:49 pm #847834Anthony
in 1.7.8 I could go in and out of sections and it would stay in “text”. Now in 1.8.0 every time I go into a section it automatically starts me off in “visual editor”, and strips the <p> tag still.
AnthonyMarch 23, 2019 at 4:55 pm #847836TomLead DeveloperLead Developer
WordPress 5.0 changed how the classic editor works, so some things do have to change, unfortunately. We’ll try to find a solution to the editor remembering whether you’re in Visual or Text.
As for the actual paragraph tags, they remain: https://www.screencast.com/t/OjOkVEoDuKdb
The extra spaces are stripped, which I believe is a WordPress 5.0 thing, unfortunately.March 23, 2019 at 4:59 pm #847841Anthony
I wonder why it’s getting rid of the paragraph tags for me and not you.
I wonder if I have some function that’s messing with it.
Frustrating if you don’t have a backup of the code somewhere you have to add back the code that was stripped simply from going to the visual editor.March 23, 2019 at 5:00 pm #847843TomLead DeveloperLead DeveloperMarch 23, 2019 at 5:09 pm #847848Anthony
I do not. Clearing cache didn’t work for me ]:March 24, 2019 at 5:46 am #848123Anthony
Also when I disable the visual editor it gets removed in the normal editor, but it’s still present in the sections editor.
This is kind of frustrating haha.
Why does WordPress insist on stripping out these tags. I can’t keep going back and putting in these tags it’s getting very frustrating.
- You must be logged in to reply to this topic.