mirror of
https://codeberg.org/davrot/forgejo.git
synced 2025-05-16 11:00:02 +02:00
Improve Wiki TOC (#24137)
The old code has a lot of technical debts, eg: `repo/wiki/view.tmpl` / `Iterate` This PR improves the Wiki TOC display and improves the code. --------- Co-authored-by: delvh <dev.lh@web.de>
This commit is contained in:
parent
f045e58cc7
commit
1ab16e48cc
12 changed files with 129 additions and 118 deletions
|
@ -34,7 +34,7 @@ func nodeToTable(meta *yaml.Node) ast.Node {
|
|||
|
||||
func mappingNodeToTable(meta *yaml.Node) ast.Node {
|
||||
table := east.NewTable()
|
||||
alignments := []east.Alignment{}
|
||||
alignments := make([]east.Alignment, 0, len(meta.Content)/2)
|
||||
for i := 0; i < len(meta.Content); i += 2 {
|
||||
alignments = append(alignments, east.AlignNone)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue