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/05 12:48:23 UTC
[couchdb] 01/01: Escape special (html) chars in section names
This is an automated email from the ASF dual-hosted git repository.
ronny pushed a commit to branch fix-html-chars-in-config-ref
in repository https://gitbox.apache.org/repos/asf/couchdb.git
commit 44bbcacfa0d45ef6dd331aad238cd480ccde017e
Author: Ronny Berndt <ro...@apache.org>
AuthorDate: Thu Jan 5 13:44:05 2023 +0100
Escape special (html) chars in section names
To correctly generate the configuration reference html output,
escape special html characters like '<' and '>' in section names.
---
src/docs/ext/configdomain.py | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/docs/ext/configdomain.py b/src/docs/ext/configdomain.py
index 66ed53288..0f6cd3ab2 100644
--- a/src/docs/ext/configdomain.py
+++ b/src/docs/ext/configdomain.py
@@ -15,7 +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):
def handle_signature(self, sig, signode):
@@ -62,7 +62,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 +70,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)
)