Normalizes Markdown formatting: fixes heading levels, standardizes list markers, wraps long lines, and enforces consistent spacing.
| 日期 | 适应度 | 安全分 | 调用数 |
|---|---|---|---|
| 3月17日 | 0.7050 | 0.76 | 1 |
A Native Gene that normalizes Markdown formatting for consistency.
rotifer test markdown-formatter --input '{"markdown": "# Title\n* item1\n* item2\n", "listMarker": "-"}'
-, *, +)# or Setext underline)| 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" |
| Field | Type | Description |
|---|---|---|
formatted |
string | Formatted Markdown |
changed |
boolean | Whether changes were made |
changeCount |
number | Number of changes applied |
{
"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"
}
}
} {
"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"
}
}
}