Search code examples
python-sphinxrestructuredtext

Remove blank line generated due to comments in restructured text


I am writing documentation in RST and generating HTML using Sphinx.

I want to comment out some text but the HTML is inserting a blank line.

* Line1
.. * Line2
* Line3
* Line4

The HTML prints a blank line between Line1 and Line3. How do I remove this blank line?


Solution

  • Your reST is faulty as it is missing blank lines. Besides, you should indent the comment to avoid ending the list and then start a new one.

    * Line1
    
      .. * Line2
    
    * Line3
    * Line4