EnlighterJS / Plugin.WordPress

:package: Official WordPress Plugin of EnlighterJS
http://wordpress.org/plugins/enlighter/
GNU General Public License v2.0
115 stars 17 forks source link

somewhat random italicization #364

Closed gessel closed 1 year ago

gessel commented 1 year ago

Describe the bug unexpected italization in code highlighting

WordPress Editing Mode Which WordPress editing mode you're using ?

Frontend or Backend Issue

Frontend

To Reproduce

Format the code (below) as bash.

Expected behavior more consistent font use - in particular less apparently random italicization.

Screenshots

image

Example code

https://blackrosetech.com/gessel/2022/09/02/smol-bash-script-for-finding-oversize-media-files

#!/usr/bin/bash

# check arguments passed and set defaults if needed
# No argument given?
if [ -z "$1" ]; then
  printf "\nUsage:\n\n  pass a starting point and min data rate in kbps and min size like /media/gessel/datas/Downloads/ 100 10 \n\n" 
  exit 1
fi

if [ -z "$2" ]; then
  printf "\nUsage:\n\n  returning files with data rate greater than default max of 100 kbps  \n\n" 
  maxr=100
  else
        maxr=$2
        echo -e "\n\n  returning files with dara rate greater than " $maxr " kbps  \n\n" 
fi

if [ -z "$3" ]; then
  printf "\nUsage:\n\n  returning files with file size greater than default max of 100 MB  \n\n" 
  maxs=10
  else
        maxs=$3
        echo -e "\n\n  returning files with dara rate greater than " $maxs " MB  \n\n" 
fi

# multipliers to get to human readable values
msec="1000"
kilo="1024"

echo -e "file path \t rate kbps \t size MB"

# search for files with the extensions enumerated below
# edit this list to your needs (e.g. -iname \*.mp3 or whatever
# the -o means "or", -iname (vs -name) means case independent so
# it will find .MKV and .mkv.
# then pass each file found to check if the data rate is 
# above the min rate of concern and then if the files size is 
# above the min size of concern, and if so, print the result

find "$1" -type f \( -iname \*.avi -o -iname \*.mkv -o -iname \*.mp4 -o -iname \*.wmv \) -print0 | while read -rd $'\0' file
do
    size="$(wc -c  "$file" |  awk '{print $1}')"
    duration="$(mediainfo --Inform="Video;%Duration%" "$file")"
    seconds=$(bc -l <<<"${duration}/${msec}")
    sizek=$(bc -l <<<"scale=1; ${size}/${kilo}")
    sizem=$(bc -l <<<"scale=1; ${sizek}/${kilo}")
    rate=$(bc -l <<<"scale=1; ${sizek}/${seconds}")
    if (( $(bc  <<<"$rate > $maxr") )); then
        if (( $(bc  <<<"$sizem > $maxs") )); then
            echo -e $file "\t" $rate "\t" $sizem
        fi
    fi
done

Desktop (please complete the following information):

AndiDittrich commented 1 year ago

you've some weird "MathJax" plugin installed with messes the EnlighterJS markup...

gessel commented 1 year ago

You're correct and furthermore, though mathjax is very cool, I couldn't find a single post that was making use of it. Fixed, thanks!