Minor nitpick, but I don't think there's any value in exposing a public `toc` reader. To keep the interface consistent across filters, I think it's better to just have one way of accessing filter outputs - via the `result` hash. The other change you'd need to make is update `append_toc` to return the toc rather than assign it to `@toc`:

```ruby
result[:toc] = append_toc text, name, uniq
```