Product weekly
This week we shipped FluxMark 0.1. See the release notes.
| Module | Owner | Status |
|---|---|---|
| Parser | Lin | Complete |
| Renderer | Chen | In progress |
const ready = true
console.log(ready)
Type check
Publish documentation
FluxMark organizes block structure with physical indentation and expresses inline properties with pipe modifiers. It is not a Markdown compatibility layer: code blocks, data tables, tasks, and links have their own syntax.
Examples marked as Live result compile in your browser. Each one switches between rendered output, formatted HTML and the transformed AST, with parsing and rendering timings shown at the bottom.
# Product weekly
This week we shipped [FluxMark 0.1|b,#3451b2]. See the [release notes|https://example.com/releases,?Open in a new window].
> [tip] Review note
Table fields and code content must be indented relative to their parent block.
@ Release status
- Module: Parser | Owner: Lin | Status: Complete
- Module: Renderer | Owner: Chen | Status: In progress
$ ts
const ready = true
console.log(ready)
* [x] Type check
* [ ] Publish documentation
---This week we shipped FluxMark 0.1. See the release notes.
| Module | Owner | Status |
|---|---|---|
| Parser | Lin | Complete |
| Renderer | Chen | In progress |
const ready = true
console.log(ready)
Type check
Publish documentation
{
"type": "Document",
"line": 1,
"column": 1,
"indent": -1,
"range": {
"start": 0,
"end": 490
},
"children": [
{
"line": 1,
"column": 1,
"indent": 0,
"range": {
"start": 0,
"end": 490
},
"type": "Section",
"level": 1,
"title": [
{
"type": "text",
"content": "Product weekly",
"style": {
"bold": false,
"italic": false,
"underline": false,
"strike": false,
"mark": false,
"code": false,
"color": null,
"href": null,
"tooltip": null,
"customModifiers": []
},
"attributes": {}
}
],
"children": [
{
"line": 2,
"column": 3,
"indent": 2,
"range": {
"start": 17,
"end": 141
},
"type": "Paragraph",
"tokens": [
{
"type": "text",
"content": "This week we shipped ",
"style": {
"bold": false,
"italic": false,
"underline": false,
"strike": false,
"mark": false,
"code": false,
"color": null,
"href": null,
"tooltip": null,
"customModifiers": []
},
"attributes": {}
},
{
"type": "style",
"content": "FluxMark 0.1",
"style": {
"bold": true,
"italic": false,
"underline": false,
"strike": false,
"mark": false,
"code": false,
"color": "#3451b2",
"href": null,
"tooltip": null,
"customModifiers": []
},
"attributes": {}
},
{
"type": "text",
"content": ". See the ",
"style": {
"bold": false,
"italic": false,
"underline": false,
"strike": false,
"mark": false,
"code": false,
"color": null,
"href": null,
"tooltip": null,
"customModifiers": []
},
"attributes": {}
},
{
"type": "style",
"content": "release notes",
"style": {
"bold": false,
"italic": false,
"underline": false,
"strike": false,
"mark": false,
"code": false,
"color": null,
"href": "https://example.com/releases",
"tooltip": "Open in a new window",
"customModifiers": []
},
"attributes": {}
},
{
"type": "text",
"content": ".",
"style": {
"bold": false,
"italic": false,
"underline": false,
"strike": false,
"mark": false,
"code": false,
"color": null,
"href": null,
"tooltip": null,
"customModifiers": []
},
"attributes": {}
}
]
},
{
"line": 4,
"column": 3,
"indent": 2,
"range": {
"start": 143,
"end": 248
},
"type": "Callout",
"variant": "tip",
"title": [
{
"type": "text",
"content": "Review note",
"style": {
"bold": false,
"italic": false,
"underline": false,
"strike": false,
"mark": false,
"code": false,
"color": null,
"href": null,
"tooltip": null,
"customModifiers": []
},
"attributes": {}
}
],
"children": [
{
"line": 5,
"column": 5,
"indent": 4,
"range": {
"start": 165,
"end": 247
},
"type": "Paragraph",
"tokens": [
{
"type": "text",
"content": "Table fields and code content must be indented relative to their parent block.",
"style": {
"bold": false,
"italic": false,
"underline": false,
"strike": false,
"mark": false,
"code": false,
"color": null,
"href": null,
"tooltip": null,
"customModifiers": []
},
"attributes": {}
}
]
}
]
},
{
"line": 7,
"column": 3,
"indent": 2,
"range": {
"start": 249,
"end": 380
},
"type": "DataTable",
"title": [
{
"type": "text",
"content": "Release status",
"style": {
"bold": false,
"italic": false,
"underline": false,
"strike": false,
"mark": false,
"code": false,
"color": null,
"href": null,
"tooltip": null,
"customModifiers": []
},
"attributes": {}
}
],
"columns": [
"Module",
"Owner",
"Status"
],
"rows": [
{
"line": 8,
"cells": {
"Module": {
"line": 8,
"tokens": [
{
"type": "text",
"content": "Parser",
"style": {
"bold": false,
"italic": false,
"underline": false,
"strike": false,
"mark": false,
"code": false,
"color": null,
"href": null,
"tooltip": null,
"customModifiers": []
},
"attributes": {}
}
]
},
"Owner": {
"line": 8,
"tokens": [
{
"type": "text",
"content": "Lin",
"style": {
"bold": false,
"italic": false,
"underline": false,
"strike": false,
"mark": false,
"code": false,
"color": null,
"href": null,
"tooltip": null,
"customModifiers": []
},
"attributes": {}
}
]
},
"Status": {
"line": 8,
"tokens": [
{
"type": "text",
"content": "Complete",
"style": {
"bold": false,
"italic": false,
"underline": false,
"strike": false,
"mark": false,
"code": false,
"color": null,
"href": null,
"tooltip": null,
"customModifiers": []
},
"attributes": {}
}
]
}
}
},
{
"line": 9,
"cells": {
"Module": {
"line": 9,
"tokens": [
{
"type": "text",
"content": "Renderer",
"style": {
"bold": false,
"italic": false,
"underline": false,
"strike": false,
"mark": false,
"code": false,
"color": null,
"href": null,
"tooltip": null,
"customModifiers": []
},
"attributes": {}
}
]
},
"Owner": {
"line": 9,
"tokens": [
{
"type": "text",
"content": "Chen",
"style": {
"bold": false,
"italic": false,
"underline": false,
"strike": false,
"mark": false,
"code": false,
"color": null,
"href": null,
"tooltip": null,
"customModifiers": []
},
"attributes": {}
}
]
},
"Status": {
"line": 9,
"tokens": [
{
"type": "text",
"content": "In progress",
"style": {
"bold": false,
"italic": false,
"underline": false,
"strike": false,
"mark": false,
"code": false,
"color": null,
"href": null,
"tooltip": null,
"customModifiers": []
},
"attributes": {}
}
]
}
}
}
]
},
{
"line": 11,
"column": 3,
"indent": 2,
"range": {
"start": 381,
"end": 434
},
"type": "CodeBlock",
"language": "ts",
"lines": [
"const ready = true",
"console.log(ready)",
""
],
"code": "const ready = true\nconsole.log(ready)\n"
},
{
"line": 15,
"column": 3,
"indent": 2,
"range": {
"start": 435,
"end": 483
},
"type": "List",
"ordered": false,
"start": 1,
"children": [
{
"line": 15,
"column": 3,
"indent": 2,
"range": {
"start": 435,
"end": 453
},
"type": "ListItem",
"marker": "*",
"ordinal": null,
"checked": true,
"taskMarkerOffset": 440,
"children": [
{
"line": 15,
"column": 3,
"indent": 2,
"range": {
"start": 435,
"end": 453
},
"type": "Paragraph",
"tokens": [
{
"type": "text",
"content": "Type check",
"style": {
"bold": false,
"italic": false,
"underline": false,
"strike": false,
"mark": false,
"code": false,
"color": null,
"href": null,
"tooltip": null,
"customModifiers": []
},
"attributes": {}
}
]
}
]
},
{
"line": 16,
"column": 3,
"indent": 2,
"range": {
"start": 454,
"end": 483
},
"type": "ListItem",
"marker": "*",
"ordinal": null,
"checked": false,
"taskMarkerOffset": 459,
"children": [
{
"line": 16,
"column": 3,
"indent": 2,
"range": {
"start": 454,
"end": 483
},
"type": "Paragraph",
"tokens": [
{
"type": "text",
"content": "Publish documentation",
"style": {
"bold": false,
"italic": false,
"underline": false,
"strike": false,
"mark": false,
"code": false,
"color": null,
"href": null,
"tooltip": null,
"customModifiers": []
},
"attributes": {}
}
]
}
]
}
]
},
{
"line": 17,
"column": 3,
"indent": 2,
"range": {
"start": 484,
"end": 489
},
"type": "HorizontalRule"
}
]
}
],
"issues": []
}Blank lines separate paragraphs and other structures. Block nesting is determined by physical indentation, not by closing markers.
A child block must be indented at least one column beyond its parent. A space counts as one indentation column; a tab always counts as two. The parser records both the indentation width and the number of source characters used by the indentation.
# Parent section
A paragraph that still belongs to the parent section.
> [note] A sibling callout
This paragraph belongs to the callout.
Content after the parent sectionA paragraph that still belongs to the parent section.
Content after the parent section
{
"type": "Document",
"line": 1,
"column": 1,
"indent": -1,
"range": {
"start": 0,
"end": 178
},
"children": [
{
"line": 1,
"column": 1,
"indent": 0,
"range": {
"start": 0,
"end": 144
},
"type": "Section",
"level": 1,
"title": [
{
"type": "text",
"content": "Parent section",
"style": {
"bold": false,
"italic": false,
"underline": false,
"strike": false,
"mark": false,
"code": false,
"color": null,
"href": null,
"tooltip": null,
"customModifiers": []
},
"attributes": {}
}
],
"children": [
{
"line": 2,
"column": 3,
"indent": 2,
"range": {
"start": 17,
"end": 72
},
"type": "Paragraph",
"tokens": [
{
"type": "text",
"content": "A paragraph that still belongs to the parent section.",
"style": {
"bold": false,
"italic": false,
"underline": false,
"strike": false,
"mark": false,
"code": false,
"color": null,
"href": null,
"tooltip": null,
"customModifiers": []
},
"attributes": {}
}
]
},
{
"line": 3,
"column": 3,
"indent": 2,
"range": {
"start": 73,
"end": 144
},
"type": "Callout",
"variant": "note",
"title": [
{
"type": "text",
"content": "A sibling callout",
"style": {
"bold": false,
"italic": false,
"underline": false,
"strike": false,
"mark": false,
"code": false,
"color": null,
"href": null,
"tooltip": null,
"customModifiers": []
},
"attributes": {}
}
],
"children": [
{
"line": 4,
"column": 5,
"indent": 4,
"range": {
"start": 102,
"end": 144
},
"type": "Paragraph",
"tokens": [
{
"type": "text",
"content": "This paragraph belongs to the callout.",
"style": {
"bold": false,
"italic": false,
"underline": false,
"strike": false,
"mark": false,
"code": false,
"color": null,
"href": null,
"tooltip": null,
"customModifiers": []
},
"attributes": {}
}
]
}
]
}
]
},
{
"line": 5,
"column": 1,
"indent": 0,
"range": {
"start": 145,
"end": 177
},
"type": "Paragraph",
"tokens": [
{
"type": "text",
"content": "Content after the parent section",
"style": {
"bold": false,
"italic": false,
"underline": false,
"strike": false,
"mark": false,
"code": false,
"color": null,
"href": null,
"tooltip": null,
"customModifiers": []
},
"attributes": {}
}
]
}
],
"issues": []
}Sibling blocks normally use the same indentation. When indentation returns to the parent level or becomes shallower, the current container ends. Avoid mixing tabs and spaces for visual alignment; consistent spaces are easier to maintain.
Use one to six # characters followed by whitespace and a title:
# Level one
## Level two
### Level threeThe actual level also depends on nesting depth. It is the current section depth plus the number of # characters, capped at six. Section titles are parsed as inline tokens; the body becomes Section.children.
# Outer
# Inner
The inner section uses the outer section depth plus its own hash count.> starts a callout. The default variant is quote, and a variant name can be given explicitly before the title:
> A plain quotation
> [note] A note
> [tip] A tip
> [warn] A warning
> [danger] Dangerous operation
This paragraph belongs to the danger callout.A plain quotation
{
"type": "Document",
"line": 1,
"column": 1,
"indent": -1,
"range": {
"start": 0,
"end": 148
},
"children": [
{
"line": 1,
"column": 1,
"indent": 0,
"range": {
"start": 0,
"end": 19
},
"type": "Callout",
"variant": "quote",
"title": [
{
"type": "text",
"content": "A plain quotation",
"style": {
"bold": false,
"italic": false,
"underline": false,
"strike": false,
"mark": false,
"code": false,
"color": null,
"href": null,
"tooltip": null,
"customModifiers": []
},
"attributes": {}
}
],
"children": []
},
{
"line": 2,
"column": 1,
"indent": 0,
"range": {
"start": 20,
"end": 35
},
"type": "Callout",
"variant": "note",
"title": [
{
"type": "text",
"content": "A note",
"style": {
"bold": false,
"italic": false,
"underline": false,
"strike": false,
"mark": false,
"code": false,
"color": null,
"href": null,
"tooltip": null,
"customModifiers": []
},
"attributes": {}
}
],
"children": []
},
{
"line": 3,
"column": 1,
"indent": 0,
"range": {
"start": 36,
"end": 49
},
"type": "Callout",
"variant": "tip",
"title": [
{
"type": "text",
"content": "A tip",
"style": {
"bold": false,
"italic": false,
"underline": false,
"strike": false,
"mark": false,
"code": false,
"color": null,
"href": null,
"tooltip": null,
"customModifiers": []
},
"attributes": {}
}
],
"children": []
},
{
"line": 4,
"column": 1,
"indent": 0,
"range": {
"start": 50,
"end": 68
},
"type": "Callout",
"variant": "warn",
"title": [
{
"type": "text",
"content": "A warning",
"style": {
"bold": false,
"italic": false,
"underline": false,
"strike": false,
"mark": false,
"code": false,
"color": null,
"href": null,
"tooltip": null,
"customModifiers": []
},
"attributes": {}
}
],
"children": []
},
{
"line": 5,
"column": 1,
"indent": 0,
"range": {
"start": 69,
"end": 148
},
"type": "Callout",
"variant": "danger",
"title": [
{
"type": "text",
"content": "Dangerous operation",
"style": {
"bold": false,
"italic": false,
"underline": false,
"strike": false,
"mark": false,
"code": false,
"color": null,
"href": null,
"tooltip": null,
"customModifiers": []
},
"attributes": {}
}
],
"children": [
{
"line": 6,
"column": 3,
"indent": 2,
"range": {
"start": 100,
"end": 147
},
"type": "Paragraph",
"tokens": [
{
"type": "text",
"content": "This paragraph belongs to the danger callout.",
"style": {
"bold": false,
"italic": false,
"underline": false,
"strike": false,
"mark": false,
"code": false,
"color": null,
"href": null,
"tooltip": null,
"customModifiers": []
},
"attributes": {}
}
]
}
]
}
],
"issues": []
}The built-in variants are quote, note, tip, warn, and danger. Variant names are case-insensitive and are stored lowercase in the AST. An unregistered [name] is not treated as a variant and remains part of the default quote title. Register additional names through parser options or a plugin's calloutVariants.
A line containing $, optionally followed by a language identifier, starts a code block. The indented lines that follow are code, and there is no closing fence:
$ ts
function greet(name: string): string {
return `Hello ${name}`
}function greet(name: string): string {
return `Hello ${name}`
}
{
"type": "Document",
"line": 1,
"column": 1,
"indent": -1,
"range": {
"start": 0,
"end": 77
},
"children": [
{
"line": 1,
"column": 1,
"indent": 0,
"range": {
"start": 0,
"end": 77
},
"type": "CodeBlock",
"language": "ts",
"lines": [
"function greet(name: string): string {",
" return `Hello ${name}`",
"}",
""
],
"code": "function greet(name: string): string {\n return `Hello ${name}`\n}\n"
}
],
"issues": []
}Use $ alone when no language is needed. The parser removes the smallest common indentation of the non-blank code lines while preserving their relative indentation and blank lines. The block ends when indentation returns to the $ line's level or becomes shallower. Code content is not parsed as inline markup.
@ starts a data table, optionally followed by a title. For uniform records, make the first item a pipe-separated header row, then write values positionally:
@ Project status
- Module | Status | Coverage
- Parser | Stable | 95%
- Renderer | Beta | 88%| Module | Status | Coverage |
|---|---|---|
| Parser | Stable | 95% |
| Renderer | Beta | 88% |
{
"type": "Document",
"line": 1,
"column": 1,
"indent": -1,
"range": {
"start": 0,
"end": 100
},
"children": [
{
"line": 1,
"column": 1,
"indent": 0,
"range": {
"start": 0,
"end": 100
},
"type": "DataTable",
"title": [
{
"type": "text",
"content": "Project status",
"style": {
"bold": false,
"italic": false,
"underline": false,
"strike": false,
"mark": false,
"code": false,
"color": null,
"href": null,
"tooltip": null,
"customModifiers": []
},
"attributes": {}
}
],
"columns": [
"Module",
"Status",
"Coverage"
],
"rows": [
{
"line": 3,
"cells": {
"Module": {
"line": 3,
"tokens": [
{
"type": "text",
"content": "Parser",
"style": {
"bold": false,
"italic": false,
"underline": false,
"strike": false,
"mark": false,
"code": false,
"color": null,
"href": null,
"tooltip": null,
"customModifiers": []
},
"attributes": {}
}
]
},
"Status": {
"line": 3,
"tokens": [
{
"type": "text",
"content": "Stable",
"style": {
"bold": false,
"italic": false,
"underline": false,
"strike": false,
"mark": false,
"code": false,
"color": null,
"href": null,
"tooltip": null,
"customModifiers": []
},
"attributes": {}
}
]
},
"Coverage": {
"line": 3,
"tokens": [
{
"type": "text",
"content": "95%",
"style": {
"bold": false,
"italic": false,
"underline": false,
"strike": false,
"mark": false,
"code": false,
"color": null,
"href": null,
"tooltip": null,
"customModifiers": []
},
"attributes": {}
}
]
}
}
},
{
"line": 4,
"cells": {
"Module": {
"line": 4,
"tokens": [
{
"type": "text",
"content": "Renderer",
"style": {
"bold": false,
"italic": false,
"underline": false,
"strike": false,
"mark": false,
"code": false,
"color": null,
"href": null,
"tooltip": null,
"customModifiers": []
},
"attributes": {}
}
]
},
"Status": {
"line": 4,
"tokens": [
{
"type": "text",
"content": "Beta",
"style": {
"bold": false,
"italic": false,
"underline": false,
"strike": false,
"mark": false,
"code": false,
"color": null,
"href": null,
"tooltip": null,
"customModifiers": []
},
"attributes": {}
}
]
},
"Coverage": {
"line": 4,
"tokens": [
{
"type": "text",
"content": "88%",
"style": {
"bold": false,
"italic": false,
"underline": false,
"strike": false,
"mark": false,
"code": false,
"color": null,
"href": null,
"tooltip": null,
"customModifiers": []
},
"attributes": {}
}
]
}
}
}
]
}
],
"issues": []
}The header row is recognized when the first item has multiple fields and no key: syntax. It declares column names once instead of repeating them on every record.
For sparse records whose columns vary, use explicit key-value records instead. Multiple fields on one record are separated by |:
@ Contact
- Name: Ada | Role: Maintainer
- Name: Lin | Site: [Home page|https://example.com]Additional key-value fields can follow a record on subsequent lines inside the table scope. These continuation lines may use exactly the record's indentation or be indented further. A line at the @ line's indentation or shallower closes the table. Blank lines are skipped while the table remains open.
Columns are stored in DataTable.columns in first-appearance order. Each value row becomes an entry in DataTable.rows, and cells are looked up by column name. Missing positional and key-value cells stay missing in the AST and render as empty cells.
Only a | outside backticks and square brackets separates fields. In header mode, the first row must have at least two non-empty labels. In key-value mode, each field must have a non-empty column name, a colon, and an optional value. A malformed field produces a parse warning and is ignored. This is not a Markdown pipe table: there is no separator row.
Unordered lists use - or *. Additional hyphens create deeper outline levels:
- First item
-- Nested item
--- Deeper item
* Another first-level itemOrdered lists use numbers followed by a period. Segmented numbers express nesting levels:
1. Prepare
2. Build
2.1. Compile SDK
2.2. Build documentation
3. PublishList.start is the final ordinal segment of the first item. ListItem.ordinal stores the complete sequence, for example [2, 1]. Additional blocks under a list item can be indented past the marker line.
Tasks use a -, +, or * list marker and a state box. The state character can be a space, x, or X:
- [ ] Pending
+ [x] Done
* [X] Also donePending
Done
Also done
{
"type": "Document",
"line": 1,
"column": 1,
"indent": -1,
"range": {
"start": 0,
"end": 41
},
"children": [
{
"line": 1,
"column": 1,
"indent": 0,
"range": {
"start": 0,
"end": 40
},
"type": "List",
"ordered": false,
"start": 1,
"children": [
{
"line": 1,
"column": 1,
"indent": 0,
"range": {
"start": 0,
"end": 13
},
"type": "ListItem",
"marker": "-",
"ordinal": null,
"checked": false,
"taskMarkerOffset": 3,
"children": [
{
"line": 1,
"column": 1,
"indent": 0,
"range": {
"start": 0,
"end": 13
},
"type": "Paragraph",
"tokens": [
{
"type": "text",
"content": "Pending",
"style": {
"bold": false,
"italic": false,
"underline": false,
"strike": false,
"mark": false,
"code": false,
"color": null,
"href": null,
"tooltip": null,
"customModifiers": []
},
"attributes": {}
}
]
}
]
},
{
"line": 2,
"column": 1,
"indent": 0,
"range": {
"start": 14,
"end": 24
},
"type": "ListItem",
"marker": "+",
"ordinal": null,
"checked": true,
"taskMarkerOffset": 17,
"children": [
{
"line": 2,
"column": 1,
"indent": 0,
"range": {
"start": 14,
"end": 24
},
"type": "Paragraph",
"tokens": [
{
"type": "text",
"content": "Done",
"style": {
"bold": false,
"italic": false,
"underline": false,
"strike": false,
"mark": false,
"code": false,
"color": null,
"href": null,
"tooltip": null,
"customModifiers": []
},
"attributes": {}
}
]
}
]
},
{
"line": 3,
"column": 1,
"indent": 0,
"range": {
"start": 25,
"end": 40
},
"type": "ListItem",
"marker": "*",
"ordinal": null,
"checked": true,
"taskMarkerOffset": 28,
"children": [
{
"line": 3,
"column": 1,
"indent": 0,
"range": {
"start": 25,
"end": 40
},
"type": "Paragraph",
"tokens": [
{
"type": "text",
"content": "Also done",
"style": {
"bold": false,
"italic": false,
"underline": false,
"strike": false,
"mark": false,
"code": false,
"color": null,
"href": null,
"tooltip": null,
"customModifiers": []
},
"attributes": {}
}
]
}
]
}
]
}
],
"issues": []
}In the AST, ListItem.checked is null for a regular item and false or true for a task. taskMarkerOffset points at the state character in the source, which allows an editor to update the task without reformatting the document. See task toggling.
A line with at least three hyphens and no other non-whitespace content creates a horizontal rule:
---
-----Content that does not start another block becomes a paragraph. Consecutive physical lines in the same paragraph are joined with newlines, which the inline parser turns into break tokens. The HTML renderer emits them as line breaks.
First line
Second line still belongs to the same paragraph.
A blank line starts a new paragraph.| Syntax | Effect | Style field |
|---|---|---|
*text* or **text** | Bold | bold |
_text_ | Italic | italic |
=text= | Highlight | mark |
~text~ | Strikethrough | strike |
`text` | Inline code | code |
Unpaired delimiters are treated as literal text. Content inside backticks is not interpreted as other inline styles. Underline is not created by an underscore delimiter; enable it with the pipe modifier u or underline.
A delimiter pair forms only when the opening delimiter is followed by non-whitespace and the closing delimiter is preceded by non-whitespace. Underscores surrounded by word characters are left as text.
The general form is [content|modifier,modifier]. Whitespace after commas is allowed, and modifiers are applied from left to right:
[Important|b,u]
[Italic|i]
[Marked|m]
[Strike|s]
[Code|c]
[Brand color|#3451b2]
[Short color|#fff]Important
Italic
MarkedStrikeCode
Brand color
Short color
{
"type": "Document",
"line": 1,
"column": 1,
"indent": -1,
"range": {
"start": 0,
"end": 99
},
"children": [
{
"line": 1,
"column": 1,
"indent": 0,
"range": {
"start": 0,
"end": 98
},
"type": "Paragraph",
"tokens": [
{
"type": "style",
"content": "Important",
"style": {
"bold": true,
"italic": false,
"underline": true,
"strike": false,
"mark": false,
"code": false,
"color": null,
"href": null,
"tooltip": null,
"customModifiers": []
},
"attributes": {}
},
{
"type": "break",
"content": "\n",
"style": {
"bold": false,
"italic": false,
"underline": false,
"strike": false,
"mark": false,
"code": false,
"color": null,
"href": null,
"tooltip": null,
"customModifiers": []
},
"attributes": {}
},
{
"type": "style",
"content": "Italic",
"style": {
"bold": false,
"italic": true,
"underline": false,
"strike": false,
"mark": false,
"code": false,
"color": null,
"href": null,
"tooltip": null,
"customModifiers": []
},
"attributes": {}
},
{
"type": "break",
"content": "\n",
"style": {
"bold": false,
"italic": false,
"underline": false,
"strike": false,
"mark": false,
"code": false,
"color": null,
"href": null,
"tooltip": null,
"customModifiers": []
},
"attributes": {}
},
{
"type": "style",
"content": "Marked",
"style": {
"bold": false,
"italic": false,
"underline": false,
"strike": false,
"mark": true,
"code": false,
"color": null,
"href": null,
"tooltip": null,
"customModifiers": []
},
"attributes": {}
},
{
"type": "break",
"content": "\n",
"style": {
"bold": false,
"italic": false,
"underline": false,
"strike": false,
"mark": false,
"code": false,
"color": null,
"href": null,
"tooltip": null,
"customModifiers": []
},
"attributes": {}
},
{
"type": "style",
"content": "Strike",
"style": {
"bold": false,
"italic": false,
"underline": false,
"strike": true,
"mark": false,
"code": false,
"color": null,
"href": null,
"tooltip": null,
"customModifiers": []
},
"attributes": {}
},
{
"type": "break",
"content": "\n",
"style": {
"bold": false,
"italic": false,
"underline": false,
"strike": false,
"mark": false,
"code": false,
"color": null,
"href": null,
"tooltip": null,
"customModifiers": []
},
"attributes": {}
},
{
"type": "code",
"content": "Code",
"style": {
"bold": false,
"italic": false,
"underline": false,
"strike": false,
"mark": false,
"code": true,
"color": null,
"href": null,
"tooltip": null,
"customModifiers": []
},
"attributes": {}
},
{
"type": "break",
"content": "\n",
"style": {
"bold": false,
"italic": false,
"underline": false,
"strike": false,
"mark": false,
"code": false,
"color": null,
"href": null,
"tooltip": null,
"customModifiers": []
},
"attributes": {}
},
{
"type": "style",
"content": "Brand color",
"style": {
"bold": false,
"italic": false,
"underline": false,
"strike": false,
"mark": false,
"code": false,
"color": "#3451b2",
"href": null,
"tooltip": null,
"customModifiers": []
},
"attributes": {}
},
{
"type": "break",
"content": "\n",
"style": {
"bold": false,
"italic": false,
"underline": false,
"strike": false,
"mark": false,
"code": false,
"color": null,
"href": null,
"tooltip": null,
"customModifiers": []
},
"attributes": {}
},
{
"type": "style",
"content": "Short color",
"style": {
"bold": false,
"italic": false,
"underline": false,
"strike": false,
"mark": false,
"code": false,
"color": "#fff",
"href": null,
"tooltip": null,
"customModifiers": []
},
"attributes": {}
}
]
}
],
"issues": []
}Built-in style aliases:
| Category | Modifiers |
|---|---|
| Bold | b, bold |
| Italic | i, italic |
| Underline | u, underline |
| Strikethrough | s, strike |
| Highlight | m, mark |
| Code | c, code |
| Color | Three- or six-digit hexadecimal colors such as #fff or #3451b2 |
Aliases are case-insensitive. Colors are normalized to lowercase. Other custom modifiers are recorded in FluxInlineStyle.customModifiers; plugins can also write metadata to a token's attributes.
The default renderers give special styling to the custom modifiers kbd, badge, and spoiler. A plugin can handle other names or add behavior around them.
A URL modifier appears directly on the right side of the pipe:
[FluxMark|https://github.com/Okysu/fluxmark]
[Send email|mailto:maintainers@example.com]Inline URL recognition supports http://, https://, and mailto: prefixes case-insensitively. HTML rendering still applies the URL safety check, and plugin code should not bypass safeUrl.
A modifier starting with ? sets a tooltip. The tooltip modifier absorbs all remaining modifier text, so it must come last:
[API|b,?Application Programming Interface]
[Docs|https://example.com/docs,?Open the documentation]API
Docs
{
"type": "Document",
"line": 1,
"column": 1,
"indent": -1,
"range": {
"start": 0,
"end": 99
},
"children": [
{
"line": 1,
"column": 1,
"indent": 0,
"range": {
"start": 0,
"end": 98
},
"type": "Paragraph",
"tokens": [
{
"type": "style",
"content": "API",
"style": {
"bold": true,
"italic": false,
"underline": false,
"strike": false,
"mark": false,
"code": false,
"color": null,
"href": null,
"tooltip": "Application Programming Interface",
"customModifiers": []
},
"attributes": {}
},
{
"type": "break",
"content": "\n",
"style": {
"bold": false,
"italic": false,
"underline": false,
"strike": false,
"mark": false,
"code": false,
"color": null,
"href": null,
"tooltip": null,
"customModifiers": []
},
"attributes": {}
},
{
"type": "style",
"content": "Docs",
"style": {
"bold": false,
"italic": false,
"underline": false,
"strike": false,
"mark": false,
"code": false,
"color": null,
"href": "https://example.com/docs",
"tooltip": "Open the documentation",
"customModifiers": []
},
"attributes": {}
}
]
}
],
"issues": []
}Content inside a pipe expression is raw text and is not recursively parsed as another set of inline tokens. FluxMark does not use Markdown [label](url) links.
Images reuse the same bracket grammar, with the source first and an optional alternative description after the pipe:
![https://okysu.github.io/fluxmark/logo.svg|FluxMark logo]
![https://okysu.github.io/fluxmark/logo.svg]{
"type": "Document",
"line": 1,
"column": 1,
"indent": -1,
"range": {
"start": 0,
"end": 104
},
"children": [
{
"line": 1,
"column": 1,
"indent": 0,
"range": {
"start": 0,
"end": 103
},
"type": "Paragraph",
"tokens": [
{
"type": "image",
"content": "FluxMark logo",
"style": {
"bold": false,
"italic": false,
"underline": false,
"strike": false,
"mark": false,
"code": false,
"color": null,
"href": null,
"tooltip": null,
"customModifiers": []
},
"attributes": {
"src": "https://okysu.github.io/fluxmark/logo.svg"
}
},
{
"type": "break",
"content": "\n",
"style": {
"bold": false,
"italic": false,
"underline": false,
"strike": false,
"mark": false,
"code": false,
"color": null,
"href": null,
"tooltip": null,
"customModifiers": []
},
"attributes": {}
},
{
"type": "image",
"content": "",
"style": {
"bold": false,
"italic": false,
"underline": false,
"strike": false,
"mark": false,
"code": false,
"color": null,
"href": null,
"tooltip": null,
"customModifiers": []
},
"attributes": {
"src": "https://okysu.github.io/fluxmark/logo.svg"
}
}
]
}
],
"issues": []
}![src] is a valid decorative image with empty alt; ![src|alt] adds an accessible description. The HTML renderer validates the source against the same URL policy, escapes the alternative text, and emits loading="lazy" decoding="async". Invalid sources render as escaped fallback text instead of an image element. Markdown's  syntax is not accepted.
A backslash escapes ASCII punctuation so it stays literal:
\*not bold\* and \[not a link\] and a \| literal pipe.*not bold* and [not a link] and a | literal pipe.
{
"type": "Document",
"line": 1,
"column": 1,
"indent": -1,
"range": {
"start": 0,
"end": 55
},
"children": [
{
"line": 1,
"column": 1,
"indent": 0,
"range": {
"start": 0,
"end": 54
},
"type": "Paragraph",
"tokens": [
{
"type": "text",
"content": "*not bold",
"style": {
"bold": false,
"italic": false,
"underline": false,
"strike": false,
"mark": false,
"code": false,
"color": null,
"href": null,
"tooltip": null,
"customModifiers": []
},
"attributes": {}
},
{
"type": "text",
"content": "* and ",
"style": {
"bold": false,
"italic": false,
"underline": false,
"strike": false,
"mark": false,
"code": false,
"color": null,
"href": null,
"tooltip": null,
"customModifiers": []
},
"attributes": {}
},
{
"type": "text",
"content": "[not a link",
"style": {
"bold": false,
"italic": false,
"underline": false,
"strike": false,
"mark": false,
"code": false,
"color": null,
"href": null,
"tooltip": null,
"customModifiers": []
},
"attributes": {}
},
{
"type": "text",
"content": "] and a ",
"style": {
"bold": false,
"italic": false,
"underline": false,
"strike": false,
"mark": false,
"code": false,
"color": null,
"href": null,
"tooltip": null,
"customModifiers": []
},
"attributes": {}
},
{
"type": "text",
"content": "| literal pipe.",
"style": {
"bold": false,
"italic": false,
"underline": false,
"strike": false,
"mark": false,
"code": false,
"color": null,
"href": null,
"tooltip": null,
"customModifiers": []
},
"attributes": {}
}
]
}
],
"issues": []
}Escapes apply to \, [, ], |, *, _, =, ~, backticks and the other ASCII punctuation characters. Inside code blocks and code spans, backslashes are preserved literally.
Raw HTML is represented explicitly instead of being silently passed through. Prefix an inline tag with !:
Text with !<span class="accent">inline HTML!</span>.A block starts with !html; its indented content is preserved verbatim:
!html
<div class="callout">
<strong>Raw block</strong>
</div>HTML is escaped by default. To emit it, opt in on the renderer:
renderToHTML(source, { allowHtml: true })Only enable allowHtml for trusted content. Raw HTML bypasses normal escaping and must be sanitized before rendering untrusted input.
parseFluxMark and FluxMarkParser.parse return a FluxDocument. Besides children, the document contains issues. The current built-in parser checks emit warning diagnostics for malformed table fields and invalid custom block-rule results; the issue type also permits error.
import { parseFluxMark } from 'fluxmark'
const source = `# Diagnostics
@ Table
- Name: Ada | Broken field
`
const ast = parseFluxMark(source, {
onIssue(issue) {
console.warn(`${issue.severity} at ${issue.line}:${issue.column}: ${issue.message}`)
},
})
for (const issue of ast.issues) {
console.log(issue)
}Every block node has:
line and column: one-based source positions.indent: physical indentation width.range.start and range.end: zero-based, end-exclusive source offsets.An editor can use these fields to locate diagnostics, synchronize a preview selection, or update task state while preserving the original formatting.
Inline scanning precomputes code spans, bracket pairs, and delimiter pairs. Each input character participates in a constant number of linear passes, and a failed match does not restart a scan over the remaining suffix. Block parsing advances through physical lines, and AST walking visits nodes depth first.
Plugins can add their own regular expressions, recursive scans, repeated AST walks, and HTML serialization; those costs are separate. Untrusted plugins should not be treated as sandboxed code.
Block nesting is capped at 256 levels by default to prevent stack exhaustion. Deeper content is skipped with a parse warning; set maxBlockDepth in parser options when a trusted document needs a different limit.