mirror of
https://github.com/rwinkhart/glamour-temp-MUTN.git
synced 2026-09-02 23:17:34 -04:00
Prevent irregular markdown from acccessing nil TableWriter
This commit is contained in:
@@ -85,12 +85,20 @@ func (e *TableElement) Finish(w io.Writer, ctx RenderContext) error {
|
||||
}
|
||||
|
||||
func (e *TableRowElement) Finish(w io.Writer, ctx RenderContext) error {
|
||||
if ctx.table.writer == nil {
|
||||
return nil
|
||||
}
|
||||
|
||||
ctx.table.writer.Append(ctx.table.cell)
|
||||
ctx.table.cell = []string{}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (e *TableHeadElement) Finish(w io.Writer, ctx RenderContext) error {
|
||||
if ctx.table.writer == nil {
|
||||
return nil
|
||||
}
|
||||
|
||||
ctx.table.writer.SetHeader(ctx.table.header)
|
||||
ctx.table.header = []string{}
|
||||
return nil
|
||||
|
||||
Reference in New Issue
Block a user