I just cloned the rdiscount git repo, and in 54da94bd495fb08fdedaeb9f64d604ea91c5cc66, there is
exp = %(<ul>\n <li><a href="#Level.1">Level 1</a></li>\n <li><ul>\n <li><a href="#Level.2">Level 2</a></li>\n </ul></li>\n</ul>) So there is the one with the period, not with a plus sign. If I read your test output correctly, discount gives the period, but ruby-rdiscount expects the plus. So this seems fixed in upstream git commit dc9b1ce9d764650486e812a3781122c7d96002de "update TOC tests for slight changes in discount 2.x". So I guess we will have to wait for a new upstream release or use the git/master version instead. Should I ask the upstream author to release it?
signature.asc
Description: OpenPGP digital signature