Menu

#425 Node ID will be lost when a `--language` option given.

None
closed-fixed
nobody
None
2021-10-31
2021-09-19
No

This is a reproducible example:

A test document to check the behavior of docutils.

.. _table1:
.. list-table:: Table with hyperlink target


   * - header

.. list-table:: Table with name
   :name: table2


   * - header

A reference to `table1`_ will not work because generated HTML does not contain `#table1` element if `--language` option is set to non-English.
A reference to `table2`_ will work even if any `--language` option given.

When I run docutils via rst2html.py test.rst -l zh_cn command, the table1 ID will be lost in the HTML output. Internally, docutils generates a system_message node having the node ID and suppress it on conversion.

<system_message ids="t2-1" level="1" line="11" names="t2-1" source="/spinx-error/source/02-安装.rst" type="INFO"><paragraph>No directive entry for “list-table” in module “docutils.parsers.rst.languages.zh_cn”.
Using English fallback for directive “list-table”.</paragraph></system_message>

The system_message was generated because docutils.parsers.rst.languages.zh_cn.directives does not have a key named list-table.

I think the INFO message is not needed if fallback to English succeeded.

Discussion

  • Günter Milde

    Günter Milde - 2021-09-20
    • status: open --> open-fixed
     
  • Günter Milde

    Günter Milde - 2021-09-20

    Fixed in r8831.
    Thank you for reporting.

     
  • Takeshi KOMIYA

    Takeshi KOMIYA - 2021-09-20

    Thank you for quick fix!

     
  • Günter Milde

    Günter Milde - 2021-10-31
    • status: open-fixed --> closed-fixed
     
  • Günter Milde

    Günter Milde - 2021-10-31

    Fixed in Docutils 0.18.

     

Log in to post a comment.

MongoDB Logo MongoDB