Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't print out excessive ANSI codes #27

Merged
merged 1 commit into from
Mar 7, 2024
Merged

Don't print out excessive ANSI codes #27

merged 1 commit into from
Mar 7, 2024

Conversation

silby
Copy link
Contributor

@silby silby commented Mar 7, 2024

The ANSI renderer was printing out astonishing quantities of SGR 0s, which don't hurt anything but has bad code aesthetics. Fix it to only print out font requests when the font changes.

before:

♪ pandoc$ cabal exec -- pandoc -t ansi doc/customizing-pandoc.md  | wc -c
   17986

after:

♪ pandoc$ cabal exec -- pandoc -t ansi doc/customizing-pandoc.md  | wc -c
    5297

The ANSI renderer was printing out astonishing quantities of SGR 0s,
which don't hurt anything but has bad code aesthetics. Fix it to only
print out font requests when the font changes.

before:

```
♪ pandoc$ cabal exec -- pandoc -t ansi doc/customizing-pandoc.md  | wc -c
   17986
```

after:

```
♪ pandoc$ cabal exec -- pandoc -t ansi doc/customizing-pandoc.md  | wc -c
    5297
```
@jgm jgm merged commit af65639 into jgm:master Mar 7, 2024
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants