diff --git a/README.md b/README.md index bcc1c44..c154c7a 100644 --- a/README.md +++ b/README.md @@ -9,3 +9,8 @@ This seems intended by the creators of the language. - print header tree - delph deeper into different Markdown implementations (like CommonMark) - add support for "Setext-style headers" + +#### logic ideas + +For a tree structure you will probably need parent/child relationships.\ +You might need to create a parent and a child field in the header struct. diff --git a/main.go b/main.go index e0dbcc6..1203ca6 100644 --- a/main.go +++ b/main.go @@ -78,7 +78,9 @@ func main() { header_level_count := count_levels(headings) - for key, value := range header_level_count { - fmt.Printf("Header %d occurs %d times.\n", key, value) + for i := 0; i <= 6; i++ { + if header_level_count[i] != 0 { + fmt.Printf("Header %d occurs %d times.\n", i, header_level_count[i]) + } } }