From: Pierre O. <os...@ce...> - 2021-10-11 13:40:16
|
Unfortunately there is a bug/deviation in the docutils implementation of option lists compared to how they are described. This causes it to misparse some definition lists as option lists instead. E.g. this: --something-that-looks-like-an-option But it really isn't! We just like dashes! Will result in an option list in the parsed doctree. But according to the documentation an option list requires two or more spaces after the option. So this should really be a definition list. A casual glance at the code suggests that it is this regexp that is incorrect: 'option_marker': r'%(option)s(, %(option)s)*( +| ?$)' % pats, I don't think that last '| ?$' should be there. This code has been around for at least 19 years, and it even has a test that explicitly looks for this behaviour. So I'm not sure what to do here. Either the code or the documentation needs to change. Normally I'd advocate to fix the code, but I'm not so sure if there are people relying on this after it being around for so long. (not subscribed, so cc on replies would be appreciated) Regards -- Pierre Ossman Software Development Cendio AB https://cendio.com Teknikringen 8 https://twitter.com/ThinLinc 583 30 Linköping https://facebook.com/ThinLinc Phone: +46-13-214600 A: Because it messes up the order in which people normally read text. Q: Why is top-posting such a bad thing? |