1
0
mirror of https://github.com/alecthomas/chroma.git synced 2025-02-15 13:33:12 +02:00

177 Commits

Author SHA1 Message Date
John Millikin
d7ee3c10b0 Add newlines in line number spans when wrapping in an HTML table.
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.
2018-02-25 17:52:15 +11:00
Maximilian Hils
10c530a975 http: add CONNECT method 2018-02-25 08:12:11 +11:00
John Millikin
df4ec264da Render HTML class prefixes. 2018-02-18 14:58:46 +11:00
Alec Thomas
563aadc53c Moved lexers into alphabetical sub-packages.
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.
v0.3.0
2018-02-15 21:09:02 +11:00
Alec Thomas
50a6b50a3b Slightly smarter YAML.
See #118.
2018-02-15 12:45:07 +11:00
Alec Thomas
e4cd1649a3 Ensure that HTML code column expands to full width of container.
Fixes #114.
2018-02-11 21:14:56 +11:00
MunifTanjim
03fd03809c fix func compressStyle(s string) for CSS Shorthand properties 2018-02-11 19:10:59 +11:00
Sergey Yagodkin
33dd1722d5 fix PHP comment highlighting bug (#81) 2018-02-08 22:47:56 +11:00
Alec Thomas
205105fffc Fixed newlines at end of C++ files.
Fixes #104.
2018-02-08 12:26:28 +11:00
Sergey Yagodkin
a35b8fe9bd Fix incorrect javascript comment highlight (#104) 2018-02-08 10:22:37 +11:00
Alec Thomas
35126f9a94 Implement rudimentary JSX lexer based on https://github.com/fcurella/jsx-lexer/blob/master/jsx/lexer.py
Fixes #111.
2018-02-07 22:11:40 +11:00
Sergey Yagodkin
5964ce913c Add Solidity lexer 2018-02-07 11:16:00 +11:00
Alec Thomas
38cc9bdc19 Deduplicate some strings in the Kotlin lexer. 2018-01-04 13:53:33 +11:00
Victor Kropp
9653d70371 Kotlin lexer improvements
fixes #93
2018-01-03 18:52:55 +11:00
Alec Thomas
ce92184921 Deduplicate a bunch more text, in Python3 lexer this time. 2018-01-03 11:17:47 +11:00
Alec Thomas
4afa8aa3ed Deduplicate a bunch of text in Scala lexer.
This is part of an effort to speed up compilation of the lexers package.
2018-01-03 11:04:11 +11:00
Alec Thomas
71ddf5511a Fix README for test fixtures. 2018-01-02 20:59:02 +11:00
Alec Thomas
e0f32fbcb5 Make lexer fixture running cleaner. v0.2.1 2018-01-02 15:11:41 +11:00
Alec Thomas
e56590a815 Add data-driven test framework for lexers.
See #68.
2018-01-02 14:53:25 +11:00
Alec Thomas
d26f247514 Support CSS Custom Property definitions.
Fixes #102.
2018-01-02 13:43:51 +11:00
Denis Brodbeck
c9f612c194 Fix broken css rules output
Strip leading semicolons in combination with line numbers.

fixes #98
2017-12-11 21:20:14 -08:00
Dimitri Merejkowsky
c6b01cb2a6 Ensure newline in diff lexer
Fix #96
2017-12-03 18:14:52 -08:00
Marsel Arduanov
3289a10f11 improve http lexer 2017-11-24 13:46:27 +11:00
Marsel Arduanov
27b4ff36e0 add http lexer 2017-11-24 13:46:27 +11:00
Kenneth Shaw
9401ea963f Expand single and double quote string lexing in mysql, sql, and transactsql lexers
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).
2017-11-24 13:44:34 +11:00
Alec Thomas
d08da055be Add TeX/LaTeX support.
Fixes #88.
v0.2.0
2017-11-24 13:36:50 +11:00
Alec Thomas
2e7e1e1580 Extend lexers.Get() to support filenames.
Fixes #94.
2017-11-24 13:32:17 +11:00
Steeve Chailloux
9c81d25368 Add svg support 2017-11-16 12:14:47 +11:00
Alec Thomas
75ce88603c Import SCSS lexer from Pygments. Fixes #82. 2017-11-09 10:28:14 +11:00
Dmitri Shuralyov
ca4cfa51d5 README: Fix typo. 2017-11-07 14:37:57 +11:00
Weilin Shi
20d03ba7a2 Catch some static class in csharp lexer (#78) 2017-10-30 09:23:12 +11:00
Anthony Fok
5645597739 Fix typo: translater → translator (#79) 2017-10-27 09:19:54 +11:00
Douglas La Rocca
3d8ce90892 Select lexer with --filename argument (#77)
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
2017-10-24 12:23:43 +11:00
Alec Thomas
93868c5a99 Add Objective-C and support lexer priorities.
Fixes #66.
2017-10-23 11:21:37 +11:00
Trevor Joynson
ac34ab1937 Remove binary file and add to gitignore (#72) 2017-10-23 10:50:14 +11:00
Trevor Joynson
d6eb27d4b5 Allow .mkd and .markdown (#73)
Yeah I know, but they are out there ;)
2017-10-23 10:49:04 +11:00
Kevin Burke
8533b6348b quick: add an example (#70)
Fixes #69.
2017-10-23 10:45:44 +11:00
Trevor Joynson
972d70075c Allow for /usr/bin/env shebangs (#71) 2017-10-23 10:45:29 +11:00
hexasoftware
03b0c0d6bb Changed terminal16m to semicolons (#64)
Most terminals seems to use semicolons in true colors:
https://gist.github.com/XVilka/8346728
2017-10-17 15:04:12 +11:00
Bjørn Erik Pedersen
02c4adc066 Add a chroma class wrapper when in "table mode" (#63)
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
2017-10-14 20:02:40 +11:00
Depado
4a55aefee6 Adding HasClasses method for HTML formatter (#61)
* Adding HasClasses method for HTML formatter

* Removing helper function and simply export the field
2017-10-14 08:41:40 +11:00
Bjørn Erik Pedersen
6604d06684 Regenerate TokenType stringer (#60) 2017-10-13 18:56:47 +11:00
Alec Thomas
6326cbaeff Add test for EnsureNL. 2017-10-13 10:58:37 +11:00
Bjørn Erik Pedersen
27733ac753 Add table styled line numbers (#54)
Fixes #52
2017-10-13 10:49:20 +11:00
Alec Thomas
92586fdff2 Switch shell #! to preproc. 2017-10-10 13:28:24 +11:00
Alec Thomas
fd7f3ef183 Merge pull request #56 from kaushalmodi/add-nl-for-verilog-lexers
Add newline at eof for (system)verilog lexers
2017-10-10 13:24:54 +11:00
Alec Thomas
26632c8906 Merge pull request #57 from kenshaw/add-ordering-to-styles-formatters
Fix order output of chroma cli tool
2017-10-10 13:24:37 +11:00
Kenneth Shaw
edf15b0aff Fix order output of chroma cli tool
Changes output for the chroma cli tool for styles and formatters so that
the output on --list is always in the same order.
2017-10-10 03:39:58 +07:00
Kaushal Modi
8f90f6d80a Add newline at eof for (system)verilog lexers
Fixes https://github.com/alecthomas/chroma/issues/55
2017-10-09 11:11:35 -04:00
Alec Thomas
7f66cd3f6e Merge pull request #53 from alecnunn/master
Added basic Morrowind Scripting parsing
2017-10-08 20:56:00 +11:00