You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Here's the deal : I'm using the REST API to create pages and posts on a WordPress website with Crayon installed and active. Some of those posts include code snippets encapsulated in <pre> tags. Problem is, Crayon doesn't seem to render them, it's like it doesn't see them at all, and I end-up with a generic gray square that contains my code in monochrome, no highlighting whatsoever.
At first I figured I must have done something wrong with my <pre> tags and tried all sorts of things, with the same result. So I moved on, and things got freaky.
If I edit my freshly-published pages in WordPress itself, and click "update" without touching anything else, then Crayon does its job. Even though nothing has changed in the page, according to WordPress' own "diff". In fact, updating a page without modifying it doesn't even create a revision.
Note that once I've done this "fake update" on a page, if I use the REST API to update it with more code snippets, Crayon now sees them too, and highlights them. It's like the page is "fixed" forever.
It gets freakier. If I disable Crayon and re-enable it, any page where it didn't highlight the code snippets will now be highlighted correctly.
I'm a C# programmer, I know nothing about WordPress plug-in programming, so I have no idea what it is I'm seeing and how to address it. Basically, I want to know what I need to do from my end (C# posting REST API commands to a site) to ensure that <pre> tags will be highlighted by Crayon from the get-go, without requiring human intervention.
Can you help me ?
Regards,
Jean Roch
The text was updated successfully, but these errors were encountered:
Is there a way to force Crayon to update its list of posts programmatically ? I'm looking for an HTTP request I could send to my site. I've tried manually navigating to https:///wp-admin/options.php, which is what the Refresh button appears to be doing, but that doesn't have the desired effect.
Hi,
Here's the deal : I'm using the REST API to create pages and posts on a WordPress website with Crayon installed and active. Some of those posts include code snippets encapsulated in
<pre>
tags. Problem is, Crayon doesn't seem to render them, it's like it doesn't see them at all, and I end-up with a generic gray square that contains my code in monochrome, no highlighting whatsoever.At first I figured I must have done something wrong with my
<pre>
tags and tried all sorts of things, with the same result. So I moved on, and things got freaky.If I edit my freshly-published pages in WordPress itself, and click "update" without touching anything else, then Crayon does its job. Even though nothing has changed in the page, according to WordPress' own "diff". In fact, updating a page without modifying it doesn't even create a revision.
Note that once I've done this "fake update" on a page, if I use the REST API to update it with more code snippets, Crayon now sees them too, and highlights them. It's like the page is "fixed" forever.
It gets freakier. If I disable Crayon and re-enable it, any page where it didn't highlight the code snippets will now be highlighted correctly.
I'm a C# programmer, I know nothing about WordPress plug-in programming, so I have no idea what it is I'm seeing and how to address it. Basically, I want to know what I need to do from my end (C# posting REST API commands to a site) to ensure that
<pre>
tags will be highlighted by Crayon from the get-go, without requiring human intervention.Can you help me ?
Regards,
Jean Roch
The text was updated successfully, but these errors were encountered: