question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Remove the Initial <p> tag

See original GitHub issue

Is there a way to remove the p tag that my text gets wrapped in? Right now i’m getting

<p>This is the initial content of the editor</p>

When I just want this by default This is the initial content of the editor

Thanks.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:9 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
moraleja39commented, Dec 1, 2016

If you just need a string of text, why not use <input type="text">?

0reactions
grzegorzstrzok999commented, Nov 30, 2022

In my case I have a field in CMS (processwire) and this field is designed mainly for headings and any output is already wrapped by heading tag but tinymce adds additional <p> tag to it and I would like to remove it so I don’t end up with markup like this: <h1><p>Some Heading</p></h1>

I could remove my wrapped and allow user to select correct heading in editor but the problem is that users/clients have to remember about it, it’s also additional step for them and they tend to forget about that.

so my question is, is it possible to remove <p> tag without breaking editor or is it possible to swap <p> tag for something else like <span> ?

Read more comments on GitHub >

github_iconTop Results From Across the Web

How can I remove p tags that are auto added within tinymce
I am using tinymce 4.0.1 and it automatically adds p tags when you either start typing or hit enter. How can I dynamically...
Read more >
rte remove tag p - Experience League Community - Adobe
Solved: Hi, I need to remove all the tags that are automatically inserted inside a richtext. The default use case converts a string...
Read more >
AEM Developers Courses 2022 That Really Helped Me!
In this article, we will step through my implementation for us to remove the p tag once and for all, from being rendered....
Read more >
Remove outer p tag from editor in Kendo UI for Angular
Hi John, There should always be an element holding the value for the Editor. Thus, there is no option to remove the wrapping...
Read more >
How to make the XhtmlString <p> tag go away - Novacare Blog
The TinyMCE editor used by the XhtmlString fields is highly customizable. Removing unwanted tags can be done like this: First, you must ensure ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found