Skip to content
This repository has been archived by the owner on Oct 17, 2021. It is now read-only.

CodeBlock

mattt edited this page Jan 14, 2021 · 11 revisions

CodeBlock

A code block.

public final class CodeBlock: Node

From the CommonMark Spec:

An indented code block is composed of one or more indented chunks separated by blank lines. An indented chunk is a sequence of non-blank lines, each indented four or more spaces. The contents of the code block are the literal contents of the lines, including trailing line endings, minus four spaces of indentation. An indented code block has no info string.

A code fence is a sequence of at least three consecutive backtick characters (`) or tildes (~). (Tildes and backticks cannot be mixed.) A fenced code block begins with a code fence, indented no more than three spaces.

Inheritance

Node, Visitable

Initializers

init(literal:)

public convenience init(literal: String? = nil)

init(literal:fenceInfo:)

public convenience init(literal: String, fenceInfo: String? = nil)

init(_:)

public convenience init(_ closure: () -> String)

init(_:_:)

public convenience init(_ fenceInfo: String, _ builder: () -> String)

Properties

fenceInfo

var fenceInfo: String?

Methods

accept(visitor:)

public func accept<T: Visitor>(visitor: T)
Clone this wiki locally