BlockParserPlugin class abstract
Plugin for parsing block-level markdown elements
Block plugins handle multi-line constructs like custom containers, admonitions, diagrams, etc.
Example implementing a custom admonition block:
class AdmonitionPlugin extends BlockParserPlugin {
@override
String get id => 'admonition';
@override
String get name => 'Admonition Plugin';
@override
bool canParse(String line, List<String> lines, int index) {
return line.trim().startsWith(':::');
}
@override
BlockParseResult? parse(List<String> lines, int startIndex) {
// Parse admonition block...
}
}
- Inheritance
-
- Object
- ParserPlugin
- BlockParserPlugin
- Implementers
Constructors
- BlockParserPlugin()
-
Creates a new block parser plugin
const
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- id → String
-
Unique identifier for this plugin
no setterinherited
- name → String
-
Human-readable name for this plugin
no setterinherited
- priority → int
-
Priority of this plugin (higher = checked first)
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
canParse(
String line, List< String> lines, int index) → bool - Checks if this plugin can parse the given line
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
parse(
List< String> lines, int startIndex) → BlockParseResult? - Parses a block starting at the given index
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited