⚠ This text is draft.

Test: comparing code formatting

October 19, 2026

This is an artificial post demonstrating the compare shortcode. Two snippets are shown side by side, each with its own syntax highlighting.

Default width

The snippets are separated by a line containing only ===.

Dense
fn area(w:u32,h:u32)->u32{if w==0||h==0{return 0;}w*h}
Spread out
fn area(w: u32, h: u32) -> u32 {
    if w == 0 || h == 0 {
        return 0;
    }
    w * h
}

Longer lines scroll horizontally inside their own column:

One line
let total = items.iter().filter(|i| i.active && i.price > 0).map(|i| i.price * i.count).sum::<u64>();
Wrapped
let total = items
    .iter()
    .filter(|i| i.active && i.price > 0)
    .map(|i| i.price * i.count)
    .sum::<u64>();

With max_width={40} a ruler is drawn at column 40 and everything past it is tinted:

One line
let total = items.iter().filter(|i| i.active && i.price > 0).map(|i| i.price * i.count).sum::<u64>();
Wrapped
let total = items
    .iter()
    .filter(|i| i.active && i.price > 0)
    .map(|i| i.price * i.count)
    .sum::<u64>();

Single column

The code_tab shortcode gives one snippet the same labelled look:

main.rs
fn main() {
    println!("Hello!");
}

It takes max_width too:

main.rs
fn main() {
    println!("Hello, this line is too long!");
}

Wide variant

With wide=true the block breaks out of the text column (on narrow screens it stacks vertically).

Python, before
def process(data, verbose = False, retries=3):
    result = [ x*2 for x in data if x>0 ]
    if verbose: print("done", len(result))
    return result
Python, after
def process(data, verbose=False, retries=3):
    result = [x * 2 for x in data if x > 0]
    if verbose:
        print("done", len(result))
    return result