charmbracelet / glamour

Stylesheet-based markdown rendering for your CLI apps 💇🏻‍♀️

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Code block does not show content

fzdwx opened this issue · comments

commented

test data is https://github.com/charmbracelet/glamour/blob/master/testdata/example.md

package main

import (
	"fmt"
	"github.com/charmbracelet/glamour"
	"io"
	"os"
)

func main() {
	r, err := os.Open("example.md")
	if err != nil {
		panic(err)
	}

	bytes, err := io.ReadAll(r)
	if err != nil {
		panic(err)
	}

	out, err := glamour.Render(string(bytes), "dark")
	if err != nil {
		panic(err)
	}

	fmt.Print(out)
}

image

but when i use glow it is normal again:

image

commented

... I don't know why it's working right now,sorry.

commented

There is one dependency that is different,
I just found it with github.com/muesli/termenv v0.11.1-0.20220212125758-44cd13922739 this version is fine,
and then with github.com/muesli/termenv v0.13.0 there is a code block rendering problem.

@muesli

@fzdwx If you bump termenv to v0.13.0, please also bump glamour to master. A new release will follow soon.

commented

Ok, thinks! I'm looking forward to it.