Support » Plugin: Prismatic » Sourcecode with code tags (i.e., nested code tags)

  • Resolved hiroprot

    (@hiroprot)


    I want to show HTML source code that contains code tags. As always, I enclose the source code in code tags, which results in nested code tags. This does not display correctly in the frontend because the inner closing code tag is not escaped.

    Example via screenshots to prevent character escaping by the forum:

    My configuration:

    • Prismatic 2.5
    • Prism.js library
    • Code escaping in frontend and admin area
    • WordPress classic editor
    • This topic was modified 8 months ago by hiroprot.
    • This topic was modified 8 months ago by hiroprot.
Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Jeff Starr

    (@specialk)

    Thanks for reporting. I can confirm this is a bug with the latest version of Prismatic. I have added to the to-do list and will try to resolve for the next plugin update. Thank you for reporting, @hiroprot.

    Thread Starter hiroprot

    (@hiroprot)

    Many thanks for the super-quick response. I’m looking forward to version 2.6 😉

    Plugin Author Jeff Starr

    (@specialk)

    Just to follow up. I’ve been looking into this, some notes:

    • The code-escaping regex fails for one case: nested code tags
    • The regex basically is <code>(.*)</code> so when nested, the second/outer <code> tag is ignored

    Rewriting the current regex (regular expression) to account for nested code tags will require more time than I currently possess, it’s way more complex and requires much testing, etc.

    So what I’m thinking at this point is to provide a workaround, just a simple shortcode to account for when nested code tags are required:

    [prismatic_code][/prismatic_code]

    Edit: Apparently it’s not possible to include HTML entities here in the forums. So I am replacing this part of my reply with a screenshot showing the original plain-text message. Basically you need to use HTML entities for the code tag brackets.

    It’s not ideal but wanted to provide a solution until there is time to rework the core regex. I hope it helps, @hiroprot. Thanks again for reporting, and feel free to post again with any further comments, etc.

    • This reply was modified 5 months, 1 week ago by Jeff Starr. Reason: Edits code, adds link to image
    • This reply was modified 5 months, 1 week ago by Jeff Starr. Reason: clarity
    Thread Starter hiroprot

    (@hiroprot)

    Thanks, a workaround is certainly helpful!

    Plugin Author Jeff Starr

    (@specialk)

    I added a screenshot that shows better the required HTML entities. Cheers @hiroprot!

Viewing 5 replies - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.