Open mbroadst opened 7 years ago
Unfortunately, while that trick sort of works it fails in any more complicated cases. For instance a nested directive such as:
.. method:: db.auth()
Allows a user to authenticate to the database from within the
shell.
- a user document that contains the username and password, and
optionally, the authentication mechanism and a digest password
flag.
.. code-block:: javascript
db.auth( {
user: <username>,
pwd: <password>,
mechanism: <authentication mechanism>,
digestPassword: <boolean>
} )
results in most of the code-block
directive ending up in an unknown
bucket. I tried a number of ideas including adding a rule for the DirectiveBlock
to support BodyElement+ / FailbackIndent$
, however this didn't have any effect. I'm a bit confused by the multitude of indentation rules here..
@seikichi Do you have any thoughts on how best to move forward?
Given the following example RST:
The current output from
restructured
is:It makes the incorrect assumption that all data inside the directive is just a text element, and therefore ceases to continue deeply parsing potentially more RST.
If I remove the following line, then the output seems more logical:
However, that's because its just returning null and bailing from processing the DirectiveBlock (I think, sorry I haven't used pegjs before it's been a bit confusing to read through)