• Hello! I would like to use Crayons inside TablePress table cells. I’m doing this by using the <pre> tag in the cells. However, it doesn’t seem like Crayon Syntax Highlighter is recognizing or capturing these <pre> tags (when I inspect the output table, the<pre> tags are indeed there). CSH is working as normal for other <pre> tags in the same page (not post), so I don’t think it’s a loading issue (I’ve also tried unchecking the option to try not to load CSH when not needed).

    I’ve also tried using inline tags and code, to no avail.

    If I use Chrome’s Inspector to move the entire compiled Crayon block (the one that’s working outside of the TablePress table, but on the same page) into the TablePress table cell, the syntax-highlight content does show up correctly.

    Any advice? Thanks!!!

    https://www.ads-software.com/plugins/tablepress/
    https://www.ads-software.com/plugins/crayon-syntax-highlighter/

Viewing 5 replies - 1 through 5 (of 5 total)
  • Hi,

    thanks for your post, and sorry for the trouble.

    I’m not sure why the plugin is not picking up the content in the table cells, but you can try to force by adding this line to the “functions.php” in your theme:

    add_filter( 'tablepress_cell_content', 'CrayonWP::the_content' );

    Regards,
    Tobias

    Thread Starter victorwyee

    (@victorwyee)

    Hi Tobias! Thanks for such a quick reply! And thanks for such a wonderful plugin.

    Unfortunately, your suggestion doesn’t seem to work. But it’s OK; I’m putting code snippets in a TablePress table, and just thought it’d be nice (but not necessary) to have some highlighting.

    Thanks again!
    Victor

    Hi Victor,

    ok, that’s strange. Then please also try this: Add another parameter to the Shortcode like

    [table id=123 cache_table_output=false /]

    If that also doesn’t help, I’m out of ideas here ??

    Regards,
    Tobias

    Thread Starter victorwyee

    (@victorwyee)

    Hi Tobias,

    Thanks for a second suggestion. Unfortunately, it didn’t work either… ??

    Thanks again though!
    Victor

    Hi Victor,

    that’s unfortunate. ?? I’m not sure what the Crayon plugin needs then ?? Sorry.

    Best wishes,
    Tobias

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Crayons inside TablePress cells’ is closed to new replies.