Commits

Georg Brandl committed 25833a8

#178: apply ``add_function_parentheses`` config value to C functions as promised.

  • Participants
  • Parent commits bcc9b0f

Comments (0)

Files changed (4)

 Release 0.6.2 (in development)
 ==============================
 
+* #178: apply ``add_function_parentheses`` config value to C
+  functions as promised.
+
 * #173: Respect the docutils ``title`` directive.
 
 * #172: The ``obj`` role now links to modules as promised.
     elif typ == 'ref':
         # reST label names are always lowercased
         target = ws_re.sub('', target).lower()
+    elif typ == 'cfunc':
+        # fix-up parens for C functions too
+        if titleistarget:
+            title = _fix_parens(typ, title, env)
+        # remove parentheses from the target too
+        if target.endswith('()'):
+            target = target[:-2]
     else:
         # remove all whitespace to avoid referencing problems
         target = ws_re.sub('', target)

tests/root/markup.txt

 Testing öäü...
 
 
+Object markup
+-------------
+
+:cfunc:`CFunction`.
+
 Only directive
 --------------
 

tests/test_build.py

         ".//p": 'In both.',
         ".//p": 'Always present',
         ".//title": 'set by title directive',
+        ".//span[@class='pre']": 'CFunction()',
     },
     'desc.html': {
         ".//dt[@id='mod.Cls.meth1']": '',