Support » Plugin: Prismatic » Prism.js Features Such as Line Numbers Not Working For Me

  • Resolved Kevin Muldoon

    (@fonzerelli_79)


    First off, great work on the plugin Jeff. I love the simplicity of this plugin and the ability to change to different libraries.

    I’m currently writing an article about useful syntax highlighters for WordPress. I’ve been testing Prismatic on my test WordPress website and I’ve noticed that the additional features such as Line Highlight, Line Numbers, Show Language etc, are not showing. Despite being selected.

    I’m using the Prismatic block and used some sample PHP code. No other plugins are installed on the website so I don’t believe it’s a plugin conflict. The website was recently reset too.

    Am I missing a step to use these features or is there something that would cause line numbers etc not to show, even when selected?

    Thanks.
    Kevin

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Jeff Starr

    (@specialk)

    Hi Kevin,

    Glad to help. The plugin makes no assumptions regarding which specific line(s) should be highlighted for any given user and code snippet, etc. So after enabling line numbers (for example), you still need to add the required attribute to any pre tag that you want to highlight. For example, with Line Numbers enabled in the settings, the pre tag should look like this:

    <pre data-line="2">

    That would highlight the second line. You can find which attributes are required for the various Prism plugins by visiting the respective page on the Prism.js website. Linked infos also available in the plugin documentation under the section, “Usage: Prism.js Plugins”.

    I hope this helps, let me know if I can provide any further infos.

    Thread Starter Kevin Muldoon

    (@fonzerelli_79)

    Many thanks for replying so quickly. Much appreciated.

    I had reviewed the plugin documentation area previously, but I had wrongly assumed that it wouldn’t be necessary to use CSS classes if the additional features were selected in the settings area.

    Once I started applying a few CSS classes, it was easy to understand. 🙂

    Plugin Author Jeff Starr

    (@specialk)

    I will update the docs/readme to make it more clear what is required for each of the Prism plugins. I appreciate your feedback, Kevin.

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