SF.net SVN: docutils:[9579 ] trunk/docutils/docutils/w riters/manpage.py

milde--- via Docutils-checkins <[email protected]>
Newsgroups gmane.text.docutils.cvs
Message-ID <[email protected]>
Revision: 9579
          http://sourceforge.net/p/docutils/code/9579
Author:   milde
Date:     2024-03-17 23:30:47 +0000 (Sun, 17 Mar 2024)
Log Message:
-----------
Fix "manpage" writers handling of `<raw>` elements.

The "format" attribute is a `str` with space-separated format names.

With the change, "manpage" will pass on, e.g.

    .. raw:: html manpage

       raw text for HTML and "man" pages

but skip, e.g.

    .. raw:: html odt

       raw text for HTML and OpenDocument Text

Modified Paths:
--------------
    trunk/docutils/docutils/writers/manpage.py

Modified: trunk/docutils/docutils/writers/manpage.py
===================================================================
--- trunk/docutils/docutils/writers/manpage.py	2024-03-17 23:30:40 UTC (rev 9578)
+++ trunk/docutils/docutils/writers/manpage.py	2024-03-17 23:30:47 UTC (rev 9579)
@@ -995,7 +995,7 @@
         self.body.append(self.defs['problematic'][1])
 
     def visit_raw(self, node):
-        if node.get('format') == 'manpage':
+        if 'manpage' in node.get('format', '').split():
             self.body.append(node.astext() + "\n")
         # Keep non-manpage raw text out of output:
         raise nodes.SkipNode

This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.