[pmwiki-users] highlight.js problems

Johan Bengtsson elijah at chalmers.se
Tue Nov 12 01:13:49 PST 2019


I really like pmwiki 2.2.120 but I have some problems with highlight.js. I 
tried using:
https://www.pmwiki.org/wiki/PmWiki/WikiStyles#highlight

If I follow the instructions there exactly putting %hlt languagename% before a
code block works, but a wrapping division block is unreliable or 
does not work.

This works sometimes, sometimes certain lines are not hightlighted:

>>highlight css<<
   /* These adjust the size and spacing of heading elements,
   ** most browsers have atrocious defaults for these. */
   h1, h2, h3, h4, h5, h6 { margin:1.0em 0 .6em 0; }
   h1, h2, h3, h6 { font-weight:normal; }
   h4, h5 { font-weight:bold; }
>><<


This is not working:

>>highlight bash<<
#!/bin/sh

# Remove files that have not been accessed within the previous week
/usr/bin/find /tmp -atime +7 -type f -exec /usr/bin/rm -f {} \;

echo "Tjo!"

# Remove very old files
/usr/bin/find /tmp -ctime +14 -type f -exec /usr/bin/rm -f {} \;

# Remove empty directories that have not been accessed within the previous week
/opt/gnu/bin/find /tmp -atime +7 -type d -empty -exec /usr/bin/rmdir {} \; 2>/dev/null

# Clean gimp swap/tmp dir
if [ -d /local/gimp_tmp ]; then
/usr/bin/find /local/gimp_tmp -atime +3 -type f -exec /usr/bin/rm -f {} \;
fi
>><<

I also tried this in config.php:

$EnableHighlight = 1;
$HTMLHeaderFmt['Highlight'] = '
<link rel="stylesheet" href="$PubDirUrl/highlight_js/default.min.css" />
<script src="$PubDirUrl/highlight_js/highlight.min.js"></script>';

which worked with the same limitations as described above. But I also tried
switching to someting different than "default.min.css" (from 
https://github.com/highlightjs/highlight.js/blob/master/src/styles/) but that 
seemed to have no effect.

-Johan Bengtsson

----
Systemadministratör - Chalmers IT-avdelning
Tel: 6734  https://www.chalmers.se/its


More information about the pmwiki-users mailing list