class Luce::Line

Overview

A [Line] is a sequence of zero or more characters other than line feed (U+000A) or carriage return (U+000D), followed by a line ending or by the end of file.

Defined in:

luce/line.cr

Constructors

Instance Method Summary

Constructor Detail

def self.new(content : String, tab_remaining : Int32 | Nil = nil) #

Instance Method Detail

def content : String #

A sequence of zero or more characters other than the line ending.


def is_blank_line? : Bool #

A line containing no characters, or a line containing only spaces (U+0020) or tabs (U+0009), is called a blank line. https://spec.commonmark.org/0.30/#blank-line


def tab_remaining : Int32 | Nil #

How many spaces of a tab that remains after part of it has been consumed. See: https://spec.commonmark.org/0.30/#example-6 We cannot simply expand the tabRemaining to spaces, for example

>\t\tfoo

If we expand the 2 space width tabRemaining from blockquote block into 2 spaces, so the string segment for the indented code block is:

\tfoo,

then the output will be:

<pre><code>foo
</code></pre>

instead of the expected:

<pre><code>  foo
</code></pre>