53 Commits
Author SHA1 Message Date
RandyTheSilly f4718e24c8 Replace chroma with go-highlite 2025-06-19 14:18:55 -04:00
Carlos Alexandro Becker ef3b2d1936 fix: lint issues (#280)
Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
2024-03-08 16:32:19 -03:00
Maas Lalani 9e3abf6f65 fix: properly set table alignments 2024-03-06 15:52:11 +01:00
Maas Lalani 61945eed41 Fix lint issues (#285)
* fix(lint): cascadeStyles always passed true

* fix(lint): gomnd
2024-03-02 15:10:05 -05:00
Maas Lalani 0aaa280081 fix: linter errors (#263)
* refactor: extract magic numbers to const

* fix: linter errors
2023-10-02 19:28:35 -07:00
Brian Strauch b8953ce4af fix: render urls in table (#248) 2023-08-22 12:39:50 -07:00
Carlos Alexandro Becker c783aea2e6 feat: update chroma (#154) 2023-03-08 14:38:17 +01:00
Ayman Bagabas 50e7d3bab8 fix(ansi): register chroma styles
termenv changed the order of profiles, now 1 no longer equals ANSI.
2022-10-15 05:21:37 +02:00
Ayman Bagabas a99aac8527 fix: register chroma style once
don't register chroma style if it's already registered

this could cause a "concurrent map writes" fatal error when used in a
concurrent setting like a bubbletea wish app. use a package-wide mutex
to protect registering a new style.
2022-07-27 20:34:16 +02:00
Carlos A Becker d5fb104a74 fix: do not replace comments with empty lines
Signed-off-by: Carlos A Becker <caarlos0@gmail.com>
2022-02-07 17:59:10 +01:00
Carlos A Becker 1e311cd4e1 test: made each issue a subtest
Allow each test to be a subtest, so users can run things like:

```sh
go test -v ./... -run 'TestRendererIssues/107'
```

In order to run a single issue test, which helps when trying to fix a
new one.

Signed-off-by: Carlos A Becker <caarlos0@gmail.com>
2022-02-07 17:57:27 +01:00
Leonardo e9eb51845e Implement Capitalization (#118) 2021-08-25 15:58:17 +02:00
R. Aidan Campbell 49f2da7fed fix issue where lists that didn't start at 1 were not respected (#116) 2021-08-12 03:45:29 +02:00
Brandon Wilson 8ea7b1c86c Optionally Preserving New Lines (#115) 2021-08-12 03:27:32 +02:00
Tom Payne 4292a2106d Update for latest release of yuin/goldmark
https://github.com/yuin/goldmark/commit/9e0189df270cb443c204b51e89e2b0749b98370c
broke backwards compatibility by renaming exported structs without a
bump of the module's major version.

This commit updates glamour to use goldmark's new API.
2020-12-27 15:05:46 +01:00
Sam b37f694db4 Add support for :emoji: (#92) 2020-12-06 06:21:10 +01:00
Christian Muehlhaeuser 9474015b79 Don't use chroma for Ascii profiles 2020-02-28 07:17:43 +01:00
Christian Muehlhaeuser 8d4e3f0692 Use TrueColor color profile as default
Users can override the desired profile by calling WithColorProfile.
2020-02-10 14:28:08 +01:00
Christian Muehlhaeuser 96e48d9d5b Reuse reflow's writer-pipes 2020-02-10 13:36:02 +01:00
Christian Muehlhaeuser 66b7555d75 Keep termenv profile in RenderContext 2020-01-31 14:47:00 +01:00
Christian Muehlhaeuser ac879be81a Added 'auto' style config
AutoStyleConfig points to either DarkStyleConfig or LightStyleConfig
depending on the current terminal's background color.
2020-01-14 02:01:22 +01:00
Christian Muehlhaeuser 743ecf40c5 Switch ANSI rendering to termenv to automatically convert colors between color-profiles 2020-01-13 04:40:43 +01:00
Tom Payne 6b9278b445 Define default styles in Go, not JSON 2020-01-05 05:45:40 +01:00
Christian Muehlhaeuser 3bd1742b48 Prevent irregular markdown from acccessing nil TableWriter 2019-12-30 07:04:13 +01:00
Christian Muehlhaeuser bf9cf1e06f Don't abort when encountering invalid URLs 2019-12-30 06:52:33 +01:00
Christian Muehlhaeuser 6feb55b98c Fix cascading style attributes from BlockElements 2019-12-28 07:44:29 +01:00
Christian Muehlhaeuser 84795ad72f Fix json tag for strikethrough text 2019-12-28 06:06:21 +01:00
Christian Muehlhaeuser 33bf4bcc82 Add testdata from reported issues 2019-12-28 05:50:15 +01:00
Christian Muehlhaeuser 52f841271d Don't sanitize text elements 2019-12-28 05:13:38 +01:00
Christian Muehlhaeuser de9bf211ba Drop newline after RawHTML elements 2019-12-28 04:55:53 +01:00
Christian Muehlhaeuser 7349948f7f Fix blockquote rendering 2019-12-28 01:50:18 +01:00
Christian Muehlhaeuser 8405e35ac8 Use textFromChildren to parse the aggregate content of Link nodes 2019-12-28 01:32:59 +01:00
Christian Muehlhaeuser 4c42a50164 Don't treat fragments as valid URLs 2019-12-28 00:57:24 +01:00
Christian Muehlhaeuser 5a1a0f6457 Traverse through parents to detect ignored AST children 2019-12-28 00:38:11 +01:00
Christian Muehlhaeuser 56af24c72d Add documentation for a few more types 2019-12-25 05:40:28 +01:00
Christian Muehlhaeuser 9157a40ab2 Document BlockStack and make linter happ[y/ier]. 2019-12-25 05:26:18 +01:00
Christian Muehlhaeuser a1da1963cb Document public types and methods 2019-12-25 05:19:33 +01:00
Christian Muehlhaeuser 3a479d0c85 Guard against empty/malformed markdown list entries 2019-12-24 02:45:35 +01:00
Christian Muehlhaeuser be2762f3db Let style define the indentation token 2019-12-18 19:47:58 +01:00
Christian Muehlhaeuser 92cf159a89 Fix TableElement not inheriting style from parent 2019-12-17 12:54:10 +01:00
Christian Muehlhaeuser 29ea5f002a Styles can override the table's separators 2019-12-16 21:58:40 +01:00
Christian Muehlhaeuser 300a999be5 Add ansi.StyleWriter, which wrap writer's output into a style 2019-12-16 20:06:18 +01:00
Christian Muehlhaeuser 386525047d Render tables in given style 2019-12-16 20:04:22 +01:00
Christian Muehlhaeuser 5b742594cc Automatically apply custom chroma theme when set in style 2019-12-16 08:37:31 +01:00
Christian Muehlhaeuser 27f86be69a Fix prefixing first paragraph with a newline, when there's no previous sibling node 2019-12-15 05:52:03 +01:00
Christian Muehlhaeuser 8a9d1795ff Move expected test results to testdata/ 2019-12-15 05:29:27 +01:00
Christian Muehlhaeuser 0c6cb858cf Add tests for ANSIRenderer 2019-12-15 04:24:58 +01:00
Christian Muehlhaeuser 850c3affd3 Use upstream indent & padding writers from reflow 2019-12-15 03:42:40 +01:00
Christian Muehlhaeuser b0857fb690 Follow upstream reflow API changes 2019-12-15 03:30:23 +01:00
Christian Muehlhaeuser 64af8be306 Support bold, italic & underline chroma styles 2019-12-15 00:22:27 +01:00