You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by ro...@apache.org on 2023/01/07 19:57:15 UTC

[couchdb] branch bp/3.2.2-docs/4350 created (now 95099af21)

This is an automated email from the ASF dual-hosted git repository.

ronny pushed a change to branch bp/3.2.2-docs/4350
in repository https://gitbox.apache.org/repos/asf/couchdb.git


      at 95099af21 Escape special (html) chars in section names (#4350)

This branch includes the following new commits:

     new 95099af21 Escape special (html) chars in section names (#4350)

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



[couchdb] 01/01: Escape special (html) chars in section names (#4350)

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

ronny pushed a commit to branch bp/3.2.2-docs/4350
in repository https://gitbox.apache.org/repos/asf/couchdb.git

commit 95099af21eea3860cd8f90e4b9f1b4abd6ae5553
Author: Ronny Berndt <ro...@apache.org>
AuthorDate: Sat Jan 7 20:46:43 2023 +0100

    Escape special (html) chars in section names (#4350)
    
    To correctly generate the configuration reference html output,
    escape special html characters like '<' and '>' in section names.
---
 src/docs/ext/configdomain.py | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/docs/ext/configdomain.py b/src/docs/ext/configdomain.py
index 66ed53288..983ac44b0 100644
--- a/src/docs/ext/configdomain.py
+++ b/src/docs/ext/configdomain.py
@@ -15,6 +15,7 @@ from sphinx.roles import XRefRole
 from sphinx.domains import Domain, ObjType, Index
 from sphinx.directives import ObjectDescription
 from sphinx.util.nodes import make_refnode
+import html
 
 
 class ConfigObject(ObjectDescription):
@@ -62,7 +63,7 @@ class ConfigIndex(Index):
 
     def generate(self, docnames=None):
         content = dict(
-            (name, [(name, 1, info[0], name, "", "", info[1])])
+            (html.escape(name), [(name, 1, info[0], name, "", "", info[1])])
             for name, info in self.domain.data["section"].items()
         )
 
@@ -70,7 +71,7 @@ class ConfigIndex(Index):
         for idx, info in sorted(options.items()):
             path, descr = info
             section, name = idx.split("/", 1)
-            content[section].append(
+            content[html.escape(section)].append(
                 (name, 2, path, "%s/%s" % (section, name), "", "", descr)
             )