Since these are wrapped in a `<pre>`, newlines hint the browser that the
line numbers should be on separate lines. This helps when rendering
content with broken CSS, or in a text-only browser.
This was done to speed up incremental compilation when working on
lexers. That is, modifying a single lexer will no longer require
recompiling all lexers.
This is a (slightly) backwards breaking change in that lexers are no
longer exported directly in the lexers package. The registry API is
"aliased" at the old location.
This PR converts the simple string lexing in the mysql, sql, and
transactsql lexers to an expanded node, bringing their behavior inline
with the postgres lexer.
The rationale for this change is that currently, when using Chroma to
lex a partial SQL query with these three lexers (for example, while in
the middle of writing a database query), a string will not be matched by
the mysql, sql, and transactsql lexers until the closing single or
double-quote is encountered.
This behavior can be seen by running the following in a terminal:
$ echo "select 'aoeu 0x9" |chroma -l sql
$ echo "select 'aoeu 0x9'" |chroma -l sql
With the mysql, sql, and transactsql lexers, the above two lines will
have dramatically different output. Comparatively, if using the postgres
lexer instead of the sql lexer, the above will output both lines
identically (excluding the closing quote).
This change will make for a better and more consistent user experience
in any package using chroma to highlight partial, incomplete, or
incorrect SQL, and is arguably "more correct", as all SQL lexers will
now behave the same (at least with regards to single/double-quoted
strings or quoted identifiers).
cgit's syntax highlighting filter pipes to STDIN and provides the
filename in argv; the analyzer often fails but we have access to the
original filename, so we add an optional argument to specify the
filename to use for matching a lexer when reading from STDIN; when
[files...] are provided to chroma this is completely ignored
This commits adds a div wrapper when linenumbers are formatted in table, to get the correct CSS matchers.
This commit also fixes some CSS table issues when tables are put into a larger context with other stylesheets:
* No borders.
* Overflow to fit in potentially narrower containers.
Fixes#62