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

Correctly render nested blockquotes #565

Open
MortalHappiness opened this issue Feb 10, 2024 · 1 comment
Open

Correctly render nested blockquotes #565

MortalHappiness opened this issue Feb 10, 2024 · 1 comment
Labels
enhancement New feature or request

Comments

@MortalHappiness
Copy link

MortalHappiness commented Feb 10, 2024

Is your feature request related to a problem? Please describe.

test.md

> This is a block quote
>
> > This is the nested quote
>
> This is part of the outer block quote.

Expected:

This is a block quote

This is the nested quote

This is part of the outer block quote.

Actual (You can see that "This is the nested quote" line is not rendered as nested quotes in glow):

glow -s dark test.md

image

glow -s dracula test.md

image

Describe the solution you'd like
Correctly render nested blockquotes for at least the dark and dracula themes.

Describe alternatives you've considered
No.

Additional context
None.

@MortalHappiness MortalHappiness added the enhancement New feature or request label Feb 10, 2024
@Disonantemus
Copy link

In the beginning I was confused because appears that you are testing themes, later I did think that was to show error in different theme outputs.

You're right, there is a bug in the nested blockquotes, I'm gonna put outputs from other CLI tools that do the same as glow, that is very colorful glowing but has many bugs. You can see here that all of them render your test better than glow and works in terminal.


  • Those 3 can show correct md output in terminal with colors:
    lowdown is very good, with MANY output options like: html, ms (man), pdf (pdfroff), latex.
    mdv good, install with pipx install mdv: https://github.com/axiros/terminal_markdown_viewer
    mdcat simple but correct output, you can pipe into less if you need.
$ lowdown -stterm test.md
      | This is a block quote
      |
      |   | This is the nested quote
      |
      | This is part of the outer block quote.

$ mdv test.md
|   This is a block quote
||  This is the nested quote
|   This is part of the outer block quote.

$ mdcat test.md
    This is a block quote

        This is the nested quote

    This is part of the outer block quote.
  • mdp has correct output, but is purpose is 4 presentations.
$ mdp test.md
                      This is a block quote

                        This is the nested quote

                      This is part of the outer block quotes
  • mandown to converting to manual pages (I did try go-md2man, but didn't pass this test):
$ mandown test.md > test.1 ; man ./test.1

test(1)              General Commands Manual              test(1)

              This is a block quote

                     This is the nested quote

              This is part of the outer block quote.

                                                          test(1)
  • There are many with html output (using a terminal web browser: w3m, lynx)
$ lowdown test.md | w3m -T text/html -dump
    This is a block quote

        This is the nested quote

    This is part of the outer block quote.

$ discount test.md | w3m -T text/html -dump
    This is a block quote

        This is the nested quote

    This is part of the outer block quote.

$ marked --silent test.md | w3m -T text/html -dump
    This is a block quote

        This is the nested quote

    This is part of the outer block quote.

Note: Here I did alias discount='markdown' because the name is too common.

  • Html output (python based):
$ markdown-it test.md | w3m -T text/html -dump
    This is a block quote

        This is the nested quote

    This is part of the outer block quote.

$ markdown_py test.md | w3m -T text/html -dump
    This is a block quote

        This is the nested quote

    This is part of the outer block quote.

There are no answer to Issues here (I did check from December, maybe more times), I also did an Issue ( #555 ) with any comment, h0rv has a fork with 8 commits ahead, not that fix your problem, but there is hope from other people. I hope this post helps you somehow.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants