primrose
Version:
Syntax-highlighting text editor that renders to an HTML5 Canvas element
14 lines (12 loc) • 377 B
JavaScript
/*
pliny.value({
parent: "Primrose.Text.Grammars",
name: "PlainText",
description: "A grammar that makes displaying plain text work with the text editor designed for syntax highlighting."
});
*/
import { Grammar } from "./Grammar.js";
export const PlainText = new Grammar("PlainText", [
["newlines", /(?:\r\n|\r|\n)/],
["whitespace", /(?:\s+)/]
]);