最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

formatting - Is there an easy way to remove the data-preserver-spaces span from blocks?

programmeradmin4浏览0评论

I converted a page from Classic to Guttenberg and now all the blocks have this span in them:

<p><span data-preserver-spaces="true">...</span></p>

This means that all the blocks appear on a grey background, which makes it harder to edit, see links, etc.

I know how to edit the HTML and remove the <span> tag like so:

<p>...</p>

but over 100 blocks, that's definitely tedious. Is there a way to do that automatically? (like a "clear all formatting" like I've see in other editors?)

Here is an example of the effect I'm talking about:

Note that it also happens when text is Italic or Bold or some other such format (which I think is also annoying).

I converted a page from Classic to Guttenberg and now all the blocks have this span in them:

<p><span data-preserver-spaces="true">...</span></p>

This means that all the blocks appear on a grey background, which makes it harder to edit, see links, etc.

I know how to edit the HTML and remove the <span> tag like so:

<p>...</p>

but over 100 blocks, that's definitely tedious. Is there a way to do that automatically? (like a "clear all formatting" like I've see in other editors?)

Here is an example of the effect I'm talking about:

Note that it also happens when text is Italic or Bold or some other such format (which I think is also annoying).

Share Improve this question edited Jul 19, 2020 at 1:48 Alexis Wilke asked Jul 19, 2020 at 1:26 Alexis WilkeAlexis Wilke 1377 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 0

I found a semi-solution for now.

The EditorsKit plugin adds a "Clear Formatting" option to the Gutenberg editor. It's a few clicks and it works only on a per paragraph basis, but at least I don't have to go to HTML and come back, which definitely takes longer.

As a bonus, it adds many other options such as superscript and subscript which I like to have handy.

发布评论

评论列表(0)

  1. 暂无评论