Skip to content

Commit

Permalink
Merge pull request #388 from robotology/debbug_997429
Browse files Browse the repository at this point in the history
Fix build with new sphinx
  • Loading branch information
traversaro authored Mar 30, 2022
2 parents 9ae2bfb + 4f2d4e5 commit 1ee24c6
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions docs/cmake.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,12 @@

# Monkey patch for sphinx generating invalid content for qcollectiongenerator
# https://bitbucket.org/birkenfeld/sphinx/issue/1435/qthelp-builder-should-htmlescape-keywords
from sphinx.util.pycompat import htmlescape
from sphinx.builders.qthelp import QtHelpBuilder
import html
try:
from sphinxcontrib.qthelp import QtHelpBuilder
except ImportError:
# sphinx < 4.0
from sphinx.builders.qthelp import QtHelpBuilder
old_build_keywords = QtHelpBuilder.build_keywords
def new_build_keywords(self, title, refs, subitems):
old_items = old_build_keywords(self, title, refs, subitems)
Expand All @@ -27,7 +31,7 @@ def new_build_keywords(self, title, refs, subitems):
before, rest = item.split("ref=\"", 1)
ref, after = rest.split("\"")
if ("<" in ref and ">" in ref):
new_items.append(before + "ref=\"" + htmlescape(ref) + "\"" + after)
new_items.append(before + "ref=\"" + html.escape(ref) + "\"" + after)
else:
new_items.append(item)
return new_items
Expand Down Expand Up @@ -125,7 +129,7 @@ def __init__(self, desc):
self.desc = desc

def __call__(self, title, targetid, main = 'main'):
return ('pair', u'%s ; %s' % (self.desc, title), targetid, main)
return ('pair', u'%s ; %s' % (self.desc, title), targetid, main, None)

_cmake_index_objs = {
'command': _cmake_index_entry('command'),
Expand Down

0 comments on commit 1ee24c6

Please sign in to comment.