ssg.md/posts/test.md
2026-05-29 09:36:12 +07:00

4.3 KiB

title: Comprehensive Markdown & GFM Syntax Reference desc: A detailed guide to Markdown and GitHub Flavored Markdown (GFM) syntax, covering text formatting, lists, tables, code blocks, links, and footnotes. date: 2026-05-27 draft: true ^---

This document serves as a comprehensive reference for Markdown and GitHub Flavored Markdown (GFM) syntax. It covers various formatting options, list types, table creation, code block usage, link formatting, and footnote implementation.

The purpose is to test and demonstrate the full range of Markdown features, ensuring that all syntax is correctly rendered and supported in the target environment. This includes both standard Markdown elements and GFM-specific extensions.

This post was generated by AI for testing purposes


Images

Alt text


HTML in Markdown

Click to expand HTML content

This is a block of HTML content embedded within Markdown. It can include any valid HTML elements, such as this bold text and this italic text.

  • HTML List Item 1
  • HTML List Item 2

^^ This **shouldn't** render as an iframe but should show the raw HTML code

Text Formatting & Structure

  • Bold: This text is bold or this is bold.
  • Italic: This text is italic or this is italic.
  • Strikethrough (GFM): This text is crossed out.
  • Combined: This text is bold and italic.
  • Inline Code: Use single backticks for console.log("Hello World") inline.

Hierarchy Example

Blockquotes: Use blockquotes to highlight quotes, notes, or warnings.

"The best way to predict the future is to invent it."

Nested blockquotes are supported by adding an extra >.


Lists

Unordered (Bulleted)

  • Item 1
    • Nested Item 1.1
    • Nested Item 1.2
  • Item 2

Ordered (Numbered)

  1. First item
  2. Second item
    1. Nested ordered item
    2. Another nested item
  3. Third item

Task Lists (GFM)

  • Write the Markdown test template
  • Implement features in production
  • Review documentation


Tables (GFM)

Feature Standard Markdown GFM Extension Status
Tables Implemented
Task Lists Implemented
Autolinks Native
Strikethrough Implemented

Code Blocks with Syntax Highlighting

#!/usr/bin/env bash
set -euo pipefail

# Variables & string manipulation
NAME="world"
GREETING="Hello, ${NAME}!"
UPPER=${GREETING^^}
SLICE=${GREETING:0:5}
echo "$UPPER | $SLICE"

# Arrays
FRUITS=(apple banana cherry)
FRUITS+=(mango)
echo "${FRUITS[@]}"          # all elements
echo "${#FRUITS[@]}"         # length
echo "${FRUITS[@]:1:2}"      # slice

# Associative array
declare -A CONFIG=([host]="localhost" [port]="8080")
echo "${CONFIG[host]}:${CONFIG[port]}"

# Arithmetic
COUNT=0
(( COUNT += 5 ))
RESULT=$(( COUNT ** 2 ))
echo "$RESULT"

# Conditionals & test operators
FILE="/etc/hosts"
if [[ -f "$FILE" && -r "$FILE" ]]; then
  echo "readable"
elif [[ -e "$FILE" ]]; then
  echo "exists but not readable"
else
  echo "not found"
fi

# Case
case "$NAME" in
  world|earth) echo "planet" ;;
  *) echo "unknown" ;;
esac

# Loops
for fruit in "${FRUITS[@]}"; do
  echo "fruit: $fruit"
done

for (( i=0; i<3; i++ )); do
  echo "i=$i"
done

WHILE=3
while (( WHILE-- > 0 )); do
  echo "while: $WHILE"
done

# Functions with local vars & return codes
greet() {
  local name=${1:-"stranger"}
  local -r greeting="Hi, $name!"
  echo "$greeting"
  return 0
}
greet "$NAME"

# Command substitution & process substitution
DATE=$(date +%Y-%m-%d)
DIFF=<(echo "foo") 
echo "Today: $DATE"

# Here-doc
cat <<EOF
Multiline
  text block
EOF

# Pipelines, redirection & traps
trap 'echo "exiting"; exit 1' ERR
echo "hello" | tr '[:lower:]' '[:upper:]' > /dev/null 2>&1

# Parameter expansion: default, error, replace
echo "${UNSET:-default}"
echo "${GREETING/Hello/Hey}"
echo "${FILE##*/}"   # basename
echo "${FILE%/*}"    # dirname