Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

how to keep wp:preformatted default? #38

Open
wkingnet opened this issue May 15, 2022 · 2 comments
Open

how to keep wp:preformatted default? #38

wkingnet opened this issue May 15, 2022 · 2 comments

Comments

@wkingnet
Copy link

wkingnet commented May 15, 2022

I noticed that Crayon changed the pre-formatted styles in wordpress.

Viewed using a code editor, the wp:preformatted block format is

<!-- wp:preformatted -->
<pre class="wp-block-preformatted">204.79.197.213 api.onedrive.com
23.76.75.24 api.onedrive.live.com
131.253.33.217 onedrive.live.com
131.253.33.217 webedgegeo.skyprod.akadns.net
131.253.14.230 skyapi.onedrive.live.com
134.170.104.157 skyweb.skyprod.akadns.net</pre>
<!-- /wp:preformatted -->

and Crayon code block format is

<!-- wp:urvanov-syntax-highlighter/code-block -->
<div class="wp-block-urvanov-syntax-highlighter-code-block"><pre class="lang:python decode:true ">
bs = BeautifulSoup(file_obj, 'lxml')
start = time.time()
for i in range(1000):
	bs.find_all(['a', 'img', 'link', 'script'])
print(f"time:{time.time() - start}")
# time:137.75350737571716</pre></div>
<!-- /wp:urvanov-syntax-highlighter/code-block -->

I think the problem is that both have the pre tag, but how to keep wp:preformatted default?

@urvanov-ru
Copy link
Owner

Yes, we have this problem now. You are right. It is because we use the same pre tag as it was in Crayon even before Gutenberg. I don't know how to fix it right now. I should somehow difference between pre for preformatted and pre form crayon in Gutenberg and use old logic for Classic Editor.
As workaround you can try to use
<pre class="crayon:false"
for preformatted blocks

@urvanov-ru
Copy link
Owner

But I will fix this problem later. I suffer from it too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants