rest comments shown in output

monkut avatarmonkut created an issue

I have rest comments at the top of my index.txt file. In previous versions of sphinx these comments were not displayed in the resulting output. (As is expected)

After upgrading to 0.6.1 these comments are now improperly being displayed in the resulting html output. Using utf-8 encoding.

I've tried making a single-line and multi-line comments, but neither seem to work

sample index.txt file:

<top of the file> .. this comment is displayed in the resulting html output.

Welcome to the Documentation

.. toctree::

Docone Doctwo

.. a comment here is ok, and not displayed <bottom of the file>

Using the comment creation as defined here:

http://docutils.sourceforge.net/docs/ref/rst/restructuredtext.html#comments

Comments (4)

  1. monkut

    hmmm... just removed the comments, and then my initial header line wasn't being detected, and displayed as text. I have a feeling this may be some kind of encoding issue, but I'm 99% sure I'm encoding the files as utf-8. Putting 4 lines of space from the top of the file to the section header gets the header (and comments? may be haven't tried yet.) to display properly.

    index title

  2. Georg Brandl
    • changed status to open

    Could you try setting

    source_encoding = 'utf-8-sig'
    

    in your conf.py? If that helps, your files are saved with a coding cookie, which upsets the reST parser. From 0.6.2 on, that encoding will be default anyway.

  3. Log in to comment
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.