Malkavian Grin Posted May 9, 2023 Clone Share Posted May 9, 2023 I usually hate using <p> tags because of the inherent margins it uses. But they are added whenever you hit enter in a new area (for instance, a new table cell). This is fine behavior--but you can't undo it. (I'm not talking about control+z). Once you have a <p> tag in an area, it's annoying to remove it unless you edit the source (and if your code is long, it's still annoying). As a coder by trade, I can do it just fine. But trying to explain to non-coders how to do such a thing just feels way too extra. I'd like to request a button that removes literally all of the formatting and tags, full-stop. I recommend just updating the "remove format" button since that is kind of the idea behind it. (if there's already a way to do this, I'd love to know about it) Thanks! Link to comment Share on other sites More sharing options...
Eric Posted May 9, 2023 Clone Share Posted May 9, 2023 Use of <p> tags is largely driven by making well-formatted HTML 5 per the specification. CKEditor does this automatically on purpose. I think I need to know more about your use case? Link to comment Share on other sites More sharing options...
Malkavian Grin Posted May 9, 2023 Author Clone Share Posted May 9, 2023 I'll give you a visual example and then explain. Item #1 Item #2 Item #3 Item #4 Item #5 Item #6 Let's say I accidentally hit Enter after I finished "Item #1"; it creates a <p> tag around the item (as it's designed to do). It now doesn't match the rest of my items. There is no way to get rid of that extra spacing without modifying the CSS of the tag or just editing source to remove the tag. A button would just make that process faster. Link to comment Share on other sites More sharing options...
Eric Posted May 9, 2023 Clone Share Posted May 9, 2023 OK. Wrapping tags are a bit different than formatting, in that we're having to consider the parent elements and whether they affect the style of the child in any way, but I'll think about it some and see what percolates out. Link to comment Share on other sites More sharing options...
Malkavian Grin Posted May 9, 2023 Author Clone Share Posted May 9, 2023 It is, however, the "remove format" button works on <b> and <i> tags, as well as stripping out CSS that aligns elements, to name a few. I figured removing a <p> tag would follow a similar process. I understand this could have future implications. I appreciate you looking into it all the same! Link to comment Share on other sites More sharing options...
Eric Posted May 9, 2023 Clone Share Posted May 9, 2023 Yeah. <b> and <i> are inline elements that can be stripped without affecting layout, but <p> is a block-level element so there are... "consequences" 😄 Link to comment Share on other sites More sharing options...
Recommended Posts