⚠ 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 ===.
fn area(w:u32,h:u32)->u32{if w==0||h==0{return 0;}w*h}
fn area(w: u32, h: u32) -> u32 {
if w == 0 || h == 0 {
return 0;
}
w * h
}
Longer lines scroll horizontally inside their own column:
let total = items.iter().filter(|i| i.active && i.price > 0).map(|i| i.price * i.count).sum::<u64>();
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:
let total = items.iter().filter(|i| i.active && i.price > 0).map(|i| i.price * i.count).sum::<u64>();
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:
fn main() {
println!("Hello!");
}
It takes max_width too:
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).
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
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