{"action":"opened","issue":{"url":"https://api.github.com/repos/spf13/hugo/issues/1912","repository_url":"https://api.github.com/repos/spf13/hugo","labels_url":"https://api.github.com/repos/spf13/hugo/issues/1912/labels{/name}","comments_url":"https://api.github.com/repos/spf13/hugo/issues/1912/comments","events_url":"https://api.github.com/repos/spf13/hugo/issues/1912/events","html_url":"https://github.com/spf13/hugo/issues/1912","id":137862226,"number":1912,"title":"Referencing a footnote multiple times lists the footnote once for each reference","user":{"login":"martinhath","id":1079024,"avatar_url":"https://avatars.githubusercontent.com/u/1079024?v=3","gravatar_id":"","url":"https://api.github.com/users/martinhath","html_url":"https://github.com/martinhath","followers_url":"https://api.github.com/users/martinhath/followers","following_url":"https://api.github.com/users/martinhath/following{/other_user}","gists_url":"https://api.github.com/users/martinhath/gists{/gist_id}","starred_url":"https://api.github.com/users/martinhath/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/martinhath/subscriptions","organizations_url":"https://api.github.com/users/martinhath/orgs","repos_url":"https://api.github.com/users/martinhath/repos","events_url":"https://api.github.com/users/martinhath/events{/privacy}","received_events_url":"https://api.github.com/users/martinhath/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2016-03-02T12:31:30Z","updated_at":"2016-03-02T12:31:30Z","closed_at":null,"body":"I don't know if this is intended or not (what would the return link do?), but I feel like duplicating the footnote is not the right way to go. The link even points to the uppermost footnote (instead of the one generated for this link).\r\n\r\nAn effect of this is if you try to reference the footnote itself in the footnote, Hugo crashes.\r\n\r\n`[^recursion]: See Recursion[^recursion]`\r\n\r\noutput: \r\n\r\n```\r\nfatal error: runtime: out of memory\r\n\r\nruntime stack:\r\nruntime.throw(0xc49b10, 0x16)\r\n\t/usr/lib/go/src/runtime/panic.go:527 +0x90\r\nruntime.sysMap(0xc9cf300000, 0x1aec60000, 0x18e600, 0xfb8498)\r\n\t/usr/lib/go/src/runtime/mem_linux.go:203 +0x9b\r\nruntime.mHeap_SysAlloc(0xf97920, 0x1aec60000, 0xc820194180)\r\n\t/usr/lib/go/src/runtime/malloc.go:426 +0x160\r\nruntime.mHeap_Grow(0xf97920, 0xd7630, 0x0)\r\n\t/usr/lib/go/src/runtime/mheap.go:628 +0x63\r\nruntime.mHeap_AllocSpanLocked(0xf97920, 0xd7630, 0x100)\r\n\t/usr/lib/go/src/runtime/mheap.go:532 +0x5f1\r\nruntime.mHeap_Alloc_m(0xf97920, 0xd7630, 0xffffff0100000000, 0x7f3d43317e10)\r\n\t/usr/lib/go/src/runtime/mheap.go:425 +0x1ac\r\nruntime.mHeap_Alloc.func1()\r\n\t/usr/lib/go/src/runtime/mheap.go:484 +0x41\r\nruntime.systemstack(0x7f3d43317e28)\r\n\t/usr/lib/go/src/runtime/asm_amd64.s:278 +0xab\r\nruntime.mHeap_Alloc(0xf97920, 0xd7630, 0x10100000000, 0x20)\r\n\t/usr/lib/go/src/runtime/mheap.go:485 +0x63\r\nruntime.largeAlloc(0x1aec5e817, 0xc800000001, 0xc82066f5f8)\r\n\t/usr/lib/go/src/runtime/malloc.go:748 +0xb3\r\nruntime.mallocgc.func3()\r\n\t/usr/lib/go/src/runtime/malloc.go:637 +0x33\r\nruntime.systemstack(0xc820022000)\r\n\t/usr/lib/go/src/runtime/asm_amd64.s:262 +0x79\r\nruntime.mstart()\r\n\t/usr/lib/go/src/runtime/proc1.go:668\r\n\r\ngoroutine 86 [running]:\r\nruntime.systemstack_switch()\r\n\t/usr/lib/go/src/runtime/asm_amd64.s:216 fp=0xc82066f498 sp=0xc82066f490\r\nruntime.mallocgc(0x1aec5e817, 0x9f2f00, 0xc800000001, 0xc83922c8e4)\r\n\t/usr/lib/go/src/runtime/malloc.go:638 +0x9c4 fp=0xc82066f568 sp=0xc82066f498\r\nruntime.newarray(0x9f2f00, 0x1aec5e817, 0xc82066f608)\r\n\t/usr/lib/go/src/runtime/malloc.go:780 +0xc9 fp=0xc82066f5a8 sp=0xc82066f568\r\nruntime.makeslice(0x9dda00, 0x1aec5e817, 0x1aec5e817, 0x0, 0x0, 0x0)\r\n\t/usr/lib/go/src/runtime/slice.go:32 +0x165 fp=0xc82066f5f8 sp=0xc82066f5a8\r\nbytes.makeSlice(0x1aec5e817, 0x0, 0x0, 0x0)\r\n\t/usr/lib/go/src/bytes/buffer.go:195 +0x64 fp=0xc82066f648 sp=0xc82066f5f8\r\nbytes.(*Buffer).grow(0xc8201ace00, 0x127, 0xbcaea0)\r\n\t/usr/lib/go/src/bytes/buffer.go:103 +0x282 fp=0xc82066f6f0 sp=0xc82066f648\r\nbytes.(*Buffer).Write(0xc8201ace00, 0xc839228840, 0x127, 0x14e, 0x0, 0x0, 0x0)\r\n\t/usr/lib/go/src/bytes/buffer.go:131 +0x4b fp=0xc82066f748 sp=0xc82066f6f0\r\ngithub.com/russross/blackfriday.(*Html).FootnoteItem(0xc82022e6c0, 0xc8201ace00, 0xc8202dbb54, 0xe, 0x3ac, 0xc839228840, 0x127, 0x14e, 0x0)\r\n\t/home/martin/go/src/github.com/russross/blackfriday/html.go:362 +0x17f fp=0xc82066f7a0 sp=0xc82066f748\r\ngithub.com/spf13/hugo/helpers.(*HugoHtmlRenderer).FootnoteItem(0xc8202b9be0, 0xc8201ace00, 0xc8202dbb54, 0xe, 0x3ac, 0xc839228840, 0x127, 0x14e, 0x0)\r\n\t<autogenerated>:10 +0xb7 fp=0xc82066f800 sp=0xc82066f7a0\r\ngithub.com/russross/blackfriday.secondPass.func1(0xc8201ace00)\r\n\t/home/martin/go/src/github.com/russross/blackfriday/markdown.go:468 +0x1bf fp=0xc82066f8c0 sp=0xc82066f800\r\ngithub.com/russross/blackfriday.(*Html).List(0xc82022e6c0, 0xc8201ace00, 0xc8202b9e60, 0x1)\r\n\t/home/martin/go/src/github.com/russross/blackfriday/html.go:386 +0x78 fp=0xc82066f900 sp=0xc82066f8c0\r\ngithub.com/russross/blackfriday.(*Html).Footnotes(0xc82022e6c0, 0xc8201ace00, 0xc8202b9e60)\r\n\t/home/martin/go/src/github.com/russross/blackfriday/html.go:348 +0x7d fp=0xc82066f938 sp=0xc82066f900\r\ngithub.com/spf13/hugo/helpers.(*HugoHtmlRenderer).Footnotes(0xc8202b9be0, 0xc8201ace00, 0xc8202b9e60)\r\n\t<autogenerated>:12 +0x67 fp=0xc82066f968 sp=0xc82066f938\r\ngithub.com/russross/blackfriday.secondPass(0xc8202c4900, 0xc8203e4000, 0x1152, 0x1335, 0x0, 0x0, 0x0)\r\n\t/home/martin/go/src/github.com/russross/blackfriday/markdown.go:473 +0x174 fp=0xc82066f9c8 sp=0xc82066f968\r\ngithub.com/russross/blackfriday.MarkdownOptions(0xc8202daa00, 0x14ac, 0x1500, 0x7f3d42ad8440, 0xc8202b9be0, 0xaa5f, 0x0, 0x0, 0x0, 0x0)\r\n\t/home/martin/go/src/github.com/russross/blackfriday/markdown.go:384 +0x3a3 fp=0xc82066fa48 sp=0xc82066f9c8\r\ngithub.com/russross/blackfriday.Markdown(0xc8202daa00, 0x14ac, 0x1500, 0x7f3d42ad8440, 0xc8202b9be0, 0xaa5f, 0x0, 0x0, 0x0)\r\n\t/home/martin/go/src/github.com/russross/blackfriday/markdown.go:340 +0x8b fp=0xc82066fab0 sp=0xc82066fa48\r\ngithub.com/spf13/hugo/helpers.markdownRenderWithTOC(0xc8202176e0, 0x0, 0x0, 0x0)\r\n\t/home/martin/go/src/github.com/spf13/hugo/helpers/content.go:237 +0xa2 fp=0xc82066fb10 sp=0xc82066fab0\r\ngithub.com/spf13/hugo/helpers.RenderBytesWithTOC(0xc8202176e0, 0x0, 0x0, 0x0)\r\n\t/home/martin/go/src/github.com/spf13/hugo/helpers/content.go:360 +0x2eb fp=0xc82066fb58 sp=0xc82066fb10\r\ngithub.com/spf13/hugo/hugolib.(*Page).renderContent(0xc820284000, 0xc8202daa00, 0x14ac, 0x1500, 0x0, 0x0, 0x0)\r\n\t/home/martin/go/src/github.com/spf13/hugo/hugolib/page.go:264 +0x27c fp=0xc82066fbe8 sp=0xc82066fb58\r\ngithub.com/spf13/hugo/hugolib.commonConvert(0xc820284000, 0x7f3d42ad8000, 0xc8200155c0, 0x0, 0x0, 0x0, 0x0)\r\n\t/home/martin/go/src/github.com/spf13/hugo/hugolib/handler_page.go:116 +0xfc fp=0xc82066fd80 sp=0xc82066fbe8\r\ngithub.com/spf13/hugo/hugolib.markdownHandler.PageConvert(0x0, 0x0, 0x0, 0xc820284000, 0x7f3d42ad8000, 0xc8200155c0, 0x0, 0x0, 0x0, 0x0)\r\n\t/home/martin/go/src/github.com/spf13/hugo/hugolib/handler_page.go:59 +0x51 fp=0xc82066fdc0 sp=0xc82066fd80\r\ngithub.com/spf13/hugo/hugolib.(*markdownHandler).PageConvert(0xc820165ec0, 0xc820284000, 0x7f3d42ad8000, 0xc8200155c0, 0x0, 0x0, 0x0, 0x0)\r\n\t<autogenerated>:107 +0xde fp=0xc82066fe18 sp=0xc82066fdc0\r\ngithub.com/spf13/hugo/hugolib.(*MetaHandle).Convert(0xc8202b60c0, 0xbbf7a0, 0xc820284000, 0xc82011e000, 0xc820217080)\r\n\t/home/martin/go/src/github.com/spf13/hugo/hugolib/handler_meta.go:77 +0x43d fp=0xc82066ff18 sp=0xc82066fe18\r\ngithub.com/spf13/hugo/hugolib.pageConverter(0xc82011e000, 0xc8202170e0, 0xc820217080, 0xc8202772a0)\r\n\t/home/martin/go/src/github.com/spf13/hugo/hugolib/site.go:796 +0x108 fp=0xc82066ff80 sp=0xc82066ff18\r\nruntime.goexit()\r\n\t/usr/lib/go/src/runtime/asm_amd64.s:1721 +0x1 fp=0xc82066ff88 sp=0xc82066ff80\r\ncreated by github.com/spf13/hugo/hugolib.(*Site).CreatePages\r\n\t/home/martin/go/src/github.com/spf13/hugo/hugolib/site.go:740 +0x63b\r\n\r\ngoroutine 1 [semacquire, 1 minutes]:\r\nsync.runtime_Semacquire(0xc8202772ac)\r\n\t/usr/lib/go/src/runtime/sema.go:43 +0x26\r\nsync.(*WaitGroup).Wait(0xc8202772a0)\r\n\t/usr/lib/go/src/sync/waitgroup.go:126 +0xb4\r\ngithub.com/spf13/hugo/hugolib.(*Site).CreatePages(0xc82011e000, 0x0, 0x0)\r\n\t/home/martin/go/src/github.com/spf13/hugo/hugolib/site.go:756 +0x801\r\ngithub.com/spf13/hugo/hugolib.(*Site).Process(0xc82011e000, 0x0, 0x0)\r\n\t/home/martin/go/src/github.com/spf13/hugo/hugolib/site.go:534 +0x3d7\r\ngithub.com/spf13/hugo/hugolib.(*Site).Build(0xc82011e000, 0x0, 0x0)\r\n\t/home/martin/go/src/github.com/spf13/hugo/hugolib/site.go:403 +0x47\r\ngithub.com/spf13/hugo/commands.buildSite(0xc82066d8cf, 0x1, 0x1, 0x0, 0x0)\r\n\t/home/martin/go/src/github.com/spf13/hugo/commands/hugo.go:535 +0xcf\r\ngithub.com/spf13/hugo/commands.build(0xc82066d9ee, 0x1, 0x1, 0x0, 0x0)\r\n\t/home/martin/go/src/github.com/spf13/hugo/commands/hugo.go:422 +0x2cd\r\ngithub.com/spf13/hugo/commands.server(0xf88020, 0xc8201630f0, 0x0, 0x1, 0x0, 0x0)\r\n\t/home/martin/go/src/github.com/spf13/hugo/commands/server.go:155 +0x780\r\ngithub.com/spf13/cobra.(*Command).execute(0xf88020, 0xc8201630a0, 0x1, 0x1, 0x0, 0x0)\r\n\t/home/martin/go/src/github.com/spf13/cobra/command.go:565 +0x63b\r\ngithub.com/spf13/cobra.(*Command).ExecuteC(0xf86c20, 0xf88020, 0x0, 0x0)\r\n\t/home/martin/go/src/github.com/spf13/cobra/command.go:656 +0x56b\r\ngithub.com/spf13/hugo/commands.Execute()\r\n\t/home/martin/go/src/github.com/spf13/hugo/commands/hugo.go:126 +0x71\r\nmain.main()\r\n\t/home/martin/go/src/github.com/spf13/hugo/main.go:24 +0x28\r\n\r\ngoroutine 17 [syscall, 1 minutes, locked to thread]:\r\nruntime.goexit()\r\n\t/usr/lib/go/src/runtime/asm_amd64.s:1721 +0x1\r\n\r\ngoroutine 18 [runnable]:\r\ngopkg.in/fsnotify%2ev1.(*Watcher).isClosed(0xc8200161e0, 0x0)\r\n\t/home/martin/go/src/gopkg.in/fsnotify.v1/inotify.go:64\r\ngopkg.in/fsnotify%2ev1.(*Watcher).readEvents(0xc8200161e0)\r\n\t/home/martin/go/src/gopkg.in/fsnotify.v1/inotify.go:214 +0x39f\r\ncreated by gopkg.in/fsnotify%2ev1.NewWatcher\r\n\t/home/martin/go/src/gopkg.in/fsnotify.v1/inotify.go:60 +0x3de\r\n\r\ngoroutine 7 [chan receive, 1 minutes]:\r\ngithub.com/spf13/viper.(*Viper).WatchConfig.func1(0xc8200182a0)\r\n\t/home/martin/go/src/github.com/spf13/viper/viper.go:266 +0x24f\r\ncreated by github.com/spf13/viper.(*Viper).WatchConfig\r\n\t/home/martin/go/src/github.com/spf13/viper/viper.go:267 +0x35\r\n\r\ngoroutine 19 [select, 1 minutes]:\r\ngithub.com/spf13/viper.(*Viper).WatchConfig.func1.1(0xc8200161e0, 0xc820147b00, 0x2c, 0xc8200182a0)\r\n\t/home/martin/go/src/github.com/spf13/viper/viper.go:247 +0x539\r\ncreated by github.com/spf13/viper.(*Viper).WatchConfig.func1\r\n\t/home/martin/go/src/github.com/spf13/viper/viper.go:263 +0x20a\r\n\r\ngoroutine 91 [chan receive, 1 minutes]:\r\ngithub.com/spf13/hugo/hugolib.converterCollator(0xc82011e000, 0xc820217080, 0xc820216900)\r\n\t/home/martin/go/src/github.com/spf13/hugo/hugolib/site.go:813 +0xa9\r\ncreated by github.com/spf13/hugo/hugolib.(*Site).CreatePages\r\n\t/home/martin/go/src/github.com/spf13/hugo/hugolib/site.go:743 +0x684\r\n```"}}