diff options
Diffstat (limited to 'vendor/github.com/yuin/goldmark/extension/table.go')
| -rw-r--r-- | vendor/github.com/yuin/goldmark/extension/table.go | 125 |
1 files changed, 58 insertions, 67 deletions
diff --git a/vendor/github.com/yuin/goldmark/extension/table.go b/vendor/github.com/yuin/goldmark/extension/table.go index c67a1e476..ee782a2c5 100644 --- a/vendor/github.com/yuin/goldmark/extension/table.go +++ b/vendor/github.com/yuin/goldmark/extension/table.go @@ -358,17 +358,17 @@ func (r *TableHTMLRenderer) RegisterFuncs(reg renderer.NodeRendererFuncRegistere } // TableAttributeFilter defines attribute names which table elements can have. -var TableAttributeFilter = html.GlobalAttributeFilter.Extend( - []byte("align"), // [Deprecated] - []byte("bgcolor"), // [Deprecated] - []byte("border"), // [Deprecated] - []byte("cellpadding"), // [Deprecated] - []byte("cellspacing"), // [Deprecated] - []byte("frame"), // [Deprecated] - []byte("rules"), // [Deprecated] - []byte("summary"), // [Deprecated] - []byte("width"), // [Deprecated] -) +// +// - align: Deprecated +// - bgcolor: Deprecated +// - border: Deprecated +// - cellpadding: Deprecated +// - cellspacing: Deprecated +// - frame: Deprecated +// - rules: Deprecated +// - summary: Deprecated +// - width: Deprecated. +var TableAttributeFilter = html.GlobalAttributeFilter.ExtendString(`align,bgcolor,border,cellpadding,cellspacing,frame,rules,summary,width`) // nolint: lll func (r *TableHTMLRenderer) renderTable( w util.BufWriter, source []byte, n gast.Node, entering bool) (gast.WalkStatus, error) { @@ -385,13 +385,13 @@ func (r *TableHTMLRenderer) renderTable( } // TableHeaderAttributeFilter defines attribute names which <thead> elements can have. -var TableHeaderAttributeFilter = html.GlobalAttributeFilter.Extend( - []byte("align"), // [Deprecated since HTML4] [Obsolete since HTML5] - []byte("bgcolor"), // [Not Standardized] - []byte("char"), // [Deprecated since HTML4] [Obsolete since HTML5] - []byte("charoff"), // [Deprecated since HTML4] [Obsolete since HTML5] - []byte("valign"), // [Deprecated since HTML4] [Obsolete since HTML5] -) +// +// - align: Deprecated since HTML4, Obsolete since HTML5 +// - bgcolor: Not Standardized +// - char: Deprecated since HTML4, Obsolete since HTML5 +// - charoff: Deprecated since HTML4, Obsolete since HTML5 +// - valign: Deprecated since HTML4, Obsolete since HTML5. +var TableHeaderAttributeFilter = html.GlobalAttributeFilter.ExtendString(`align,bgcolor,char,charoff,valign`) func (r *TableHTMLRenderer) renderTableHeader( w util.BufWriter, source []byte, n gast.Node, entering bool) (gast.WalkStatus, error) { @@ -413,13 +413,13 @@ func (r *TableHTMLRenderer) renderTableHeader( } // TableRowAttributeFilter defines attribute names which <tr> elements can have. -var TableRowAttributeFilter = html.GlobalAttributeFilter.Extend( - []byte("align"), // [Obsolete since HTML5] - []byte("bgcolor"), // [Obsolete since HTML5] - []byte("char"), // [Obsolete since HTML5] - []byte("charoff"), // [Obsolete since HTML5] - []byte("valign"), // [Obsolete since HTML5] -) +// +// - align: Obsolete since HTML5 +// - bgcolor: Obsolete since HTML5 +// - char: Obsolete since HTML5 +// - charoff: Obsolete since HTML5 +// - valign: Obsolete since HTML5. +var TableRowAttributeFilter = html.GlobalAttributeFilter.ExtendString(`align,bgcolor,char,charoff,valign`) func (r *TableHTMLRenderer) renderTableRow( w util.BufWriter, source []byte, n gast.Node, entering bool) (gast.WalkStatus, error) { @@ -439,50 +439,41 @@ func (r *TableHTMLRenderer) renderTableRow( } // TableThCellAttributeFilter defines attribute names which table <th> cells can have. -var TableThCellAttributeFilter = html.GlobalAttributeFilter.Extend( - []byte("abbr"), // [OK] Contains a short abbreviated description of the cell's content [NOT OK in <td>] - - []byte("align"), // [Obsolete since HTML5] - []byte("axis"), // [Obsolete since HTML5] - []byte("bgcolor"), // [Not Standardized] - []byte("char"), // [Obsolete since HTML5] - []byte("charoff"), // [Obsolete since HTML5] - - []byte("colspan"), // [OK] Number of columns that the cell is to span - []byte("headers"), // [OK] This attribute contains a list of space-separated - // strings, each corresponding to the id attribute of the <th> elements that apply to this element - - []byte("height"), // [Deprecated since HTML4] [Obsolete since HTML5] - - []byte("rowspan"), // [OK] Number of rows that the cell is to span - []byte("scope"), // [OK] This enumerated attribute defines the cells that - // the header (defined in the <th>) element relates to [NOT OK in <td>] - - []byte("valign"), // [Obsolete since HTML5] - []byte("width"), // [Deprecated since HTML4] [Obsolete since HTML5] -) +// +// - abbr: [OK] Contains a short abbreviated description of the cell's content [NOT OK in <td>] +// - align: Obsolete since HTML5 +// - axis: Obsolete since HTML5 +// - bgcolor: Not Standardized +// - char: Obsolete since HTML5 +// - charoff: Obsolete since HTML5 +// - colspan: [OK] Number of columns that the cell is to span +// - headers: [OK] This attribute contains a list of space-separated strings, +// each corresponding to the id attribute of the <th> elements that apply to this element +// - height: Deprecated since HTML4. Obsolete since HTML5 +// - rowspan: [OK] Number of rows that the cell is to span +// - scope: [OK] This enumerated attribute defines the cells that the header +// (defined in the <th>) element relates to [NOT OK in <td>] +// - valign: Obsolete since HTML5 +// - width: Deprecated since HTML4. Obsolete since HTML5. +var TableThCellAttributeFilter = html.GlobalAttributeFilter.ExtendString(`abbr,align,axis,bgcolor,char,charoff,colspan,headers,height,rowspan,scope,valign,width`) // nolint:lll // TableTdCellAttributeFilter defines attribute names which table <td> cells can have. -var TableTdCellAttributeFilter = html.GlobalAttributeFilter.Extend( - []byte("abbr"), // [Obsolete since HTML5] [OK in <th>] - []byte("align"), // [Obsolete since HTML5] - []byte("axis"), // [Obsolete since HTML5] - []byte("bgcolor"), // [Not Standardized] - []byte("char"), // [Obsolete since HTML5] - []byte("charoff"), // [Obsolete since HTML5] - - []byte("colspan"), // [OK] Number of columns that the cell is to span - []byte("headers"), // [OK] This attribute contains a list of space-separated - // strings, each corresponding to the id attribute of the <th> elements that apply to this element - - []byte("height"), // [Deprecated since HTML4] [Obsolete since HTML5] - - []byte("rowspan"), // [OK] Number of rows that the cell is to span - - []byte("scope"), // [Obsolete since HTML5] [OK in <th>] - []byte("valign"), // [Obsolete since HTML5] - []byte("width"), // [Deprecated since HTML4] [Obsolete since HTML5] -) +// +// - abbr: Obsolete since HTML5. [OK in <th>] +// - align: Obsolete since HTML5 +// - axis: Obsolete since HTML5 +// - bgcolor: Not Standardized +// - char: Obsolete since HTML5 +// - charoff: Obsolete since HTML5 +// - colspan: [OK] Number of columns that the cell is to span +// - headers: [OK] This attribute contains a list of space-separated strings, each corresponding +// to the id attribute of the <th> elements that apply to this element +// - height: Deprecated since HTML4. Obsolete since HTML5 +// - rowspan: [OK] Number of rows that the cell is to span +// - scope: Obsolete since HTML5. [OK in <th>] +// - valign: Obsolete since HTML5 +// - width: Deprecated since HTML4. Obsolete since HTML5. +var TableTdCellAttributeFilter = html.GlobalAttributeFilter.ExtendString(`abbr,align,axis,bgcolor,char,charoff,colspan,headers,height,rowspan,scope,valign,width`) // nolint: lll func (r *TableHTMLRenderer) renderTableCell( w util.BufWriter, source []byte, node gast.Node, entering bool) (gast.WalkStatus, error) { |
