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

glow not rendering heading levels other than top-level #646

Open
Halfwalker opened this issue Sep 6, 2024 · 6 comments
Open

glow not rendering heading levels other than top-level #646

Halfwalker opened this issue Sep 6, 2024 · 6 comments

Comments

@Halfwalker
Copy link

Halfwalker commented Sep 6, 2024

Describe the bug
glow does not seem to render headings other than top-level # Heading 1. Other levels like ## Heading 2 render in a color, but also show the ##

Setup

  • OS : Ubuntu 20.04 and 22.04
  • Shell : zsh and bash
  • Terminal Emulator : alacritty, gnome-terminal, xterm (without Hack Nerd Font)
  • Terminal Multiplexer : tmux and no tmux
  • Locale : en_US.UTF-8

Source Code
Simple test.md

# Heading 1

## Heading 2

### Heading 3

#### Heading 4

* list item
* another list item
    * sub-list item
    * and another

Normal text
*single asterisk*
**double asterisk**
_underscore_
__double underscore__

Expected behavior
The sample test.md should render appropriately. # Heading 1 renders as expected, with coloring/bold/etc. ## Heading 2 and the others only render in blue and show the heading level hashes

This may well be an unintended and unexpected confluence of factors like font, terminal etc.

Screenshots
Screenshot from 2024-09-06 10-17-21

Additional context
Using the "Hack Nerd Font" for alacritty and gnome-terminal

@DanielKaleby
Copy link

DanielKaleby commented Sep 11, 2024

They are being recognized and rendered. specifically, what is the expected formatting?

@Halfwalker
Copy link
Author

I suppose I was expecting no ## in front, and some sort of color/bold formatting to discern the heading levels.

Heading 1 is highlighted as I would expect, but the rest are all the same color and show the hashes (I guess to indicate the level ?)

I understand that just color/bold would be nice but wouldn't actually indicate the Heading level. Maybe include the ## in front but also use color/bold ?

@DanielKaleby
Copy link

This is correct, h1 is the only different one because it should be the most eye-catching, the hash symbol is still present at the other levels to indicate which level that header is, given that they have the same color.
However, since h1 is the only one that is different, it does not need a hash sign to indicate its level, since it only has one level of level 1.
There is no need for a unique color for each header, as this would not eliminate the need for characters indicating the level (a user could memorize the color associated with each level, but the color itself is not able to indicate which header is superior to another), the current design seems to be appropriate, but since everything in Glow is colorful, this might make sense..

@Halfwalker
Copy link
Author

Personally I would like colors/bolding, but keep the ## leaders. While the colors make it fast to discern like headings, the ## are a definitive indicator to the level.

Heh, if you do decide to add this, perhaps make it configurable. What looks nice in one terminal color scheme (solarized_dark) might be eye-stabbing in another :P

@dudicoco
Copy link

dudicoco commented Sep 12, 2024

FYI it is configurable: https://github.com/charmbracelet/glamour/tree/master/styles

The Catppuccin theme supports different colors per header.

@Halfwalker
Copy link
Author

Yeah, hence keeping the ## for the headers would be a good thing. But I do like the idea of different colors for each header level (hint hint) :)

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

No branches or pull requests

3 participants