module ExceptionPage::CodeColoring

Overview

Colors one line of Crystal source for the exception page, using the CSS classes in exception_page.ecr: c comment, s string, n number, t constant, k keyword.

Every piece of the line passes through HTML.escape, so the result is safe to place in the page as it is. A line that opens a string without closing it colors the rest of the line as that string, which suits a page showing single lines.

Defined in:

amber/exceptions/exception_page/code_coloring.cr

Class Method Summary

Class Method Detail

def self.highlight(line : String) : String #

[View source]