[pmwiki-users] highlight.js problems
Petko Yotov
5ko at 5ko.fr
Wed Nov 13 02:56:30 PST 2019
You need to wrap your code in the [@...code...@] escape sequence, or
precede every line with one or more spaces.
The page mentioned that highlighting works for preformatted blocks, but
not prominently enough. I've added cross-links to and from
BasicEditing#preformatted :
https://www.pmwiki.org/wiki/PmWiki/BasicEditing#preformatted
Hope this helps.
Petko
On 12/11/2019 10:13, Johan Bengtsson wrote:
> 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.
More information about the pmwiki-users
mailing list