Crayon testing

Test 1: block with language, theme, title, and marked line attributes specified
pre class=“lang:ps theme:twilight title:slipsum mark:6”

The path of the righteous man is beset on all sides by the iniquities of the selfish
and the tyranny of evil men. Blessed is he who, in the name of charity and good will,
shepherds the weak through the valley of darkness, for he is truly his brother's
keeper and the finder of lost children. And I will strike down upon thee with great
vengeance and furious anger those who would attempt to poison and destroy My brothers.
And you will know My name is the Lord when I lay My vengeance upon thee.

Test 2: block with language attribute specified, otherwise defaults
pre class=“lang:ps”

##vars
$scriptname = 'notarealscript'
$date = Get-Date -UFormat %Y%m%d

##logging
$runlog = "$scriptpath\logs\run_$date.txt"
"$date - Started run log">>$runlog

Test 3: block with no attributes specified, default settings, automatic language recognition
pre

##vars
$scriptname = 'notarealscript'
$date = Get-Date -UFormat %Y%m%d

##logging
$runlog = "$scriptpath\logs\run_$date.txt"
"$date - Started run log" >> $runlog

Test 4: block with no attributes specified, default settings, automatic language recognition
pre

$ComputerNameList = Get-Content C:\Temp\computerlist.txt
Get-CimInstance -ClassName Win32_LogicalDisk -ComputerName $ComputerNameList -Filter DriveType=3 | 
        Where-Object Deviceid -eq c: | 
            Select-Object PSComputerName, DeviceID, 
                @{Name = 'Size (GB)'; Expression = { [math]::truncate($_.size / 1GB) } }, 
                @{Name = 'Freespace (GB)'; Expression = { [math]::truncate($_.freespace / 1GB) } }

Note I can’t reproduce the single-quote parsing issue as seen here: https://powershell.org/forums/topic/add-custom-variable-to-select-object/#post-253709
When I type single quotes they are handled correctly (as seen above). Maybe this is a keyboard/language/OS localization/browser issue?

Test 5: greater than (>) entity is not displayed correctly for shell code either, so this is not a language-specific issue - it appears to be a global issue for crayon
pre class=“lang:sh”

"Hello World!" >> hello.txt

Test 6: block displaying code from another site using the url attribute - this block has no content inside the pre tags, it just has the url and then a /pre tag
pre class=“url:https://gist.githubusercontent.com/grokk-it/0febc1f6d40bcdfe9c846f28e679ab38/raw/78258d150d762d7c4be3dd8ef53cd3c2eb66fffb/crayon_ex-02


Test 7: HTML decode forced on with decode attribute (top) vs normal (bottom)
pre class=“decode:true”

>> >
<< <
'
&
"

pre

>> >
<< <
'
&
"

Test 8: Visual editor > Format > Code
>>

Test 9: Visual editor > Format > Blocks > Preformatted

>>

Test 10: Visual editor > Crayon dialog

>>

 

Test 11: code tag with decode:true attribute set
>>
The syntax of code class=“decode:true” is technically correct but the code tag does not actually use attributes, so this does nothing.

Test 12: code tag (top) vs backtick (bottom) for inline code
> < & ’ "
> < & ’ "
Interestingly, the code tag and backtick behave differently when decoding quotation marks, even though they are theoretically interchangeable.

The behavior of the code tag can be replicated by checking the “Inline” option in the Crayon dialog:
> < & ’ "

test

< >

> <

< >

> <