mirror of
https://github.com/rwinkhart/glamour-temp-MUTN.git
synced 2026-09-05 08:27:18 -04:00
Calculate block width from BlockStack & RenderContext
This commit is contained in:
+1
-2
@@ -6,7 +6,6 @@ import (
|
||||
)
|
||||
|
||||
type DocumentElement struct {
|
||||
Width uint
|
||||
}
|
||||
|
||||
func (e *DocumentElement) Render(w io.Writer, ctx RenderContext) error {
|
||||
@@ -37,7 +36,7 @@ func (e *DocumentElement) Finish(w io.Writer, ctx RenderContext) error {
|
||||
suffix := rules.Suffix
|
||||
|
||||
pw := &PaddingWriter{
|
||||
Padding: e.Width - margin,
|
||||
Padding: uint(ctx.options.WordWrap) - margin,
|
||||
PadFunc: func(wr io.Writer) {
|
||||
renderText(w, rules, " ")
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user