[docutils:feature-requests] #56 :key:value not caught as badly formed option, but rather taken as an argument

Günter Milde via Docutils-develop <[email protected]> Tue, 29 Apr 2025 12:52:08 -0000
Newsgroups gmane.text.docutils.devel
Message-ID </p/docutils/feature-requests/56/b212fcf9c1a2891a2ed5bac9f033ac2e5bd6e521.feature-requests@docutils.p.sourceforge.net>
- **status**: open --> pending
- **Priority**: 5 --> 3



---

**[feature-requests:#56] :key:value not caught as badly formed option, but rather taken as an argument**

**Status:** pending
**Group:** Default
**Created:** Fri Oct 13, 2017 09:44 AM UTC by Robin Shannon
**Last Updated:** Tue Oct 17, 2017 01:53 PM UTC
**Owner:** nobody


If your mistype your reST directive like this:

.. directive:: argument
    :key:value (note the lack of a space between ":" and "v")
    
docutils interprests this as a directive with two arguments (argument, :key:value) instead on one argument and an option key value pair. It seems like it would be nice if there was a check for the final argument given (if more than one argument is given) along the lines of:

 _emptystr, key, _emptystr, value = re.split(r"^\:(.*?)\:(.*?)", arg)
            if key in self.option_spec and key not in self.options:
                RAISE WARNING
    


---

Sent from sourceforge.net because [email protected] is subscribed to https://sourceforge.net/p/docutils/feature-requests/

To unsubscribe from further messages, a project admin can change settings at https://sourceforge.net/p/docutils/admin/feature-requests/options.  Or, if this is a mailing list, you can unsubscribe from the mailing list.