GFM Features Test
Table
| Feature | Status | Priority |
|---|---|---|
| Tables | ✅ | P1 |
| Code Blocks | ✅ | P1 |
| Math Expressions | ✅ | P2 |
| Task Lists | ✅ | P2 |
| Strikethrough | ✅ | P3 |
| Autolinks | ✅ | P3 |
Code Block
Go
// Single line comment
func main() {
/* Multi-line comment
spanning multiple lines */
name := "GFM"
count := 42
hexValue := 0xFF
fmt.Println("Hello,", name, "!", count)
// String with escape sequences
path := "C:\\Users\\test\\file.txt"
// Function call
result := calculate(10, 20)
}
func calculate(a int, b int) int {
return a + b
}
JavaScript/TypeScript
// Variables and types
const name = "GFM";
let count = 42;
var isActive = true;
// Function definition
function greet(name) {
return `Hello, ${name}!`;
}
// Arrow function
const add = (a, b) => a + b;
// Class definition
class Calculator {
constructor() {
this.result = 0;
}
add(value) {
this.result += value;
return this;
}
}
// Regular expression
const pattern = /^[a-zA-Z0-9]+$/;
const matches = "test123".match(pattern);
// Template literals
const message = `Count: ${count}, Active: ${isActive}`;
// Array and object
const items = [1, 2, 3];
const config = {
host: "localhost",
port: 8080,
ssl: true
};
Python
# Single line comment
def greet(name: str) -> str:
"""Multi-line docstring
describing the function"""
return f"Hello, {name}!"
# Variables and types
count = 42
pi = 3.14159
is_active = True
items = [1, 2, 3]
# String operations
path = r"C:\Users\test\file.txt" # Raw string
message = "Count: {}, Active: {}".format(count, is_active)
# Class definition
class Calculator:
def __init__(self):
self.result = 0
def add(self, value: int) -> 'Calculator':
self.result += value
return self
# List comprehension
squares = [x**2 for x in range(10) if x % 2 == 0]
# Dictionary
config = {
"host": "localhost",
"port": 8080,
"ssl": True
}
Rust
// Function definition
fn main() {
let name = "GFM";
let count: i32 = 42;
let is_active: bool = true;
// String formatting
println!("Hello, {}! Count: {}", name, count);
// Match expression
let result = match count {
0..=10 => "small",
11..=100 => "medium",
_ => "large"
};
// Struct definition
struct Config {
host: String,
port: u16,
ssl: bool,
}
// Vector
let items = vec![1, 2, 3];
// Result type
let value: Result<i32, String> = Ok(42);
}
Bash/Shell
#!/bin/bash
# Shell script example
# Variables
NAME="GFM"
COUNT=42
IS_ACTIVE=true
# Function definition
greet() {
local name=$1
echo "Hello, $name!"
}
# Conditional
if [ "$IS_ACTIVE" = true ]; then
echo "Active: $NAME"
fi
# Loop
for i in {1..5}; do
echo "Count: $i"
done
# Command substitution
CURRENT_DIR=$(pwd)
DATE=$(date +%Y-%m-%d)
# Regular expression matching
if [[ "$NAME" =~ ^[A-Z]+$ ]]; then
echo "All uppercase"
fi
SQL
-- SQL comment
SELECT
id,
name,
email,
created_at
FROM users
WHERE
status = 'active'
AND created_at > '2024-01-01'
ORDER BY created_at DESC
LIMIT 10;
-- Join query
SELECT
u.name,
COUNT(o.id) as order_count
FROM users u
LEFT JOIN orders o ON u.id = o.user_id
GROUP BY u.id, u.name
HAVING COUNT(o.id) > 5;
-- Insert with values
INSERT INTO users (name, email, status)
VALUES ('John Doe', 'john@example.com', 'active');
This is inline code: pprof, fmt.Println, const, function, def, fn, and SELECT.
Math Expressions
Inline math:
Block math:
Task List
- Tables render correctly
- Code blocks have syntax highlighting
- Math expressions render
- Task lists show checkboxes
- Strikethrough works
- Autolinks work
Strikethrough
This is deprecated information.
Autolinks
Visit https://example.com or email user@example.com for more information.
Links
Regular links: GitHub and Documentation.
Reference-style links: GFM Spec and Markdown Guide.
Images
Regular Image
Reference-style Image
Reference-style image:
Image with Title
Image in Paragraph
This is a paragraph with an inline image: that appears within the text flow.
Blockquote
This is a blockquote. It can span multiple lines.
And include multiple paragraphs.
Nested blockquote:
This is nested inside another blockquote.
Blockquote with bold and italic text.
Blockquote with code:
const x = 42;
Horizontal Rule
Text Formatting
Bold text and bold text (alternative syntax)
Italic text and italic text (alternative syntax)
Bold and italic and bold and italic
Bold with italic inside
Italic with bold inside
Nested Lists
Unordered Lists
- First item
- Second item
- Nested item 1
- Nested item 2
- Deeply nested item
- Third item
Ordered Lists
- First item
- Second item
- Nested item 1
- Nested item 2
- Deeply nested item
- Third item
Mixed Lists
- Unordered item
- Ordered nested item
- Another ordered item
- Another unordered item
- Nested unordered item
Nested Task Lists
- Main task
- Subtask 1
- Subtask 2
- Sub-subtask
- Another main task
Table with Code and Links
| Language | Code Example | Documentation |
|---|---|---|
| Go | fmt.Println("Hello") | Go Docs |
| JavaScript | console.log("Hello") | MDN |
| Python | print("Hello") | Python Docs |
Code Block without Language
This is a code block without language specification.
It should still render as a code block.
Escaped Characters
*Not italic* **Not bold** `Not code`
Escaped backslash: \
Escaped brackets: [Not a link](url)
Mixed Content
This paragraph contains bold, italic, inline code, a link, and strikethrough.
Blockquote with:
- List item
Code:const x = 42- Link
- Bold and italic