Just attempted to install this plugin in WP 3.5.1 and get the dredded fatal error message.
Plugin could not be activated because it triggered a fatal error.
Parse error: syntax error, unexpected T_FUNCTION, expecting ‘)’ in /home/content/html/subdomains/blog/wp-content/plugins/prism-detached/Prism_Detached.php on line 95
Any help would be greatly appreciated.
]]>Hi !
Nice work! But it seems that PrismJS has evolved in recent times, and now supports more languages??, and more syntax coloring highlightining. Does the plugin could incorporate the latest developments of PrismJs please?
GG !
++
Willy
]]>I added a bug upstream earlier. In safari 3.5 and 3.6 if there is no line-height defined specifically in your css for a pre (or maybe the body tag) then one of the functions in the line-highlighter returns NaN (safari returns the text string normal, whereas firefox performs a calculation based on its defaults and returns a number) when it should return a number.
the easiest fix is to add a line-height definition to the pre tag in the prism css files.
this is just for info. not sure if you want to fix it. I think most people who use a reset css would have this covered. On the official prism site, the styles.css (which have nothing to do with prism have a definition so the examples on screen work but the downloaded files don’t).
]]>I’ve enabled the PHP language which is great. But I’m doing something wrong with the encoding. my code is showing up as
<?php so its being encoded at some point, although it looks correct in the wordpress post editor.
Also. I guess there’s no easy way for us to add other language definitions to the plugin. It would be great if the plugin provided a folder for the prism code that we could sync our selves with the official prism site or add our own definitions to. Just an idea, havent had chance to have a look at the code yet, still trying to get everything working and themed.
]]>Initially I liked the idea of putting code in the custom fields however I’m having two problems. I’ll post them separately.
Code stored in the custom fields doesnt seem to be searchable from the default WordPress search box. I haven’t googled for a solution yet but it needs to be listed in the FAQ for the plugin.
]]>There is a bug in handler.php at least with my version of php
Fatal error: Cannot access self:: when no class scope is active in /wp-content/plugins/prism-detached/lib/Prism/Detached/Shortcode/Handler.php on line 125
I changed self to Prism_Detached_Shortcode_Handler and it seems to work ok.
I’m running PHP Version 5.3.2-1ubuntu4.18
public static function register ()
{
add_shortcode('prism',
function ($attributes)
{
//$shortCode = new self($attributes);
$shortCode = new Prism_Detached_Shortcode_Handler($attributes);
return $shortCode->handle();
}
);
}
]]>
Hello
I was wondering if you are planning on adding any PHP support. There is a fork of the original project on github which has added PHP (albeit a little buggy) https://github.com/Aaron3/prism/tree/a1825655c710bcad49a64f18661fb15805cf7dd7.
I noticed in the plugin folder that there is a vendor directory. Would it be as simple as changing the files in there for the ones from the PHP fork or have you modified their content?
I’m happy and interested to undertake the work myself to try out the PHP fork in your plugin but was hoping you may be able to give me a little information to point me in the right direction.
Regards
Jacob