public class MarkdownCodeBlock extends Object
Represents a fenced code block ( language ... ) extracted from a Markdown document.
import klyn.code.ast
import klyn.code.markdown
block = MarkdownCodeBlock("klyn", "x = 42", SourceRange(1, 0, 3, 0))
assert block.language == "klyn"
assert block.code == "x = 42"| Modifier and Type | Member | Description |
|---|---|---|
| public readonly property | codecode as String |
Source code inside the fenced block (excluding the opening and closing fence lines). |
| public readonly property | languagelanguage as String |
Lowercase language identifier on the opening code fence (or ""). |
| public readonly property | rangerange as SourceRange |
Line range of the fenced block in the enclosing Markdown document. |
| Modifier and Type | Member | Description |
|---|---|---|
| public | MarkdownCodeBlockMarkdownCodeBlock(language as String, code as String, range as SourceRange) |
Constructs a MarkdownCodeBlock. |