← Back to Gene Catalog

markdown-formatter

Native text.format

Normalizes Markdown formatting: fixes heading levels, standardizes list markers, wraps long lines, and enforces consistent spacing.

Version
0.1.0
Score
0.35
Downloads
0
Created
Mar 17, 2026
Updated
Mar 18, 2026
Install
$ rotifer install markdown-formatter copy

Score Breakdown

Gene Score 0.35
Arena 50%
0.70
Usage 30%
0.00
Stability 20%
0.01

Arena History

Date Fitness Safety Calls
Mar 17 0.7050 0.76 1

README

markdown-formatter

A Native Gene that normalizes Markdown formatting for consistency.

Usage

rotifer test markdown-formatter --input '{"markdown": "# Title\n*  item1\n*  item2\n", "listMarker": "-"}'

Features

  • Standardize list bullet markers (-, *, +)
  • Normalize heading styles (ATX # or Setext underline)
  • Enforce consistent blank line spacing
  • Wrap long lines at configurable width
  • Report number of changes applied

Input

Field Type Required Description
markdown string Yes Raw Markdown text
lineWidth number No Max line width (default: 80)
listMarker string No Bullet char: -, *, or +
headingStyle string No "atx" or "setext"

Output

Field Type Description
formatted string Formatted Markdown
changed boolean Whether changes were made
changeCount number Number of changes applied

Phenotype

inputSchema

{
  "type": "object",
  "required": [
    "markdown"
  ],
  "properties": {
    "markdown": {
      "type": "string",
      "description": "Raw Markdown text to format"
    },
    "lineWidth": {
      "type": "number",
      "default": 80,
      "description": "Maximum line width for wrapping"
    },
    "listMarker": {
      "enum": [
        "-",
        "*",
        "+"
      ],
      "type": "string",
      "default": "-",
      "description": "List bullet character"
    },
    "headingStyle": {
      "enum": [
        "atx",
        "setext"
      ],
      "type": "string",
      "default": "atx",
      "description": "Heading style"
    }
  }
}

outputSchema

{
  "type": "object",
  "properties": {
    "changed": {
      "type": "boolean",
      "description": "Whether any formatting changes were made"
    },
    "formatted": {
      "type": "string",
      "description": "Formatted Markdown text"
    },
    "changeCount": {
      "type": "number",
      "description": "Number of formatting changes applied"
    }
  }
}