Make (most) HTML links to file formats work again
[alexxy/gromacs.git] / src / gromacs / onlinehelp / helpwritercontext.cpp
index 09847d2aaba29a37454faa641fe5faf60a9d757e..d549ffda7965f194a0bd0613401918f2bfe96066 100644 (file)
@@ -83,6 +83,8 @@ struct t_sandr
 const t_sandr sandrTty[] = {
     { "\\*", "*" },
     { "\\=", "=" },
+    { "[REF]", "" },
+    { "[ref]", "" },
     { "[TT]", "" },
     { "[tt]", "" },
     { "[BB]", "" },
@@ -362,9 +364,7 @@ void HelpLinks::addLink(const std::string &linkName,
             replacement = repall(displayName, sandrTty);
             break;
         case eHelpOutputFormat_Rst:
-            replacement = formatString(
-                        ":doc:`%s <%s>`", repall(displayName, sandrTty).c_str(),
-                        targetName.c_str());
+            replacement = targetName;
             break;
         default:
             GMX_RELEASE_ASSERT(false, "Output format not implemented for links");
@@ -508,6 +508,8 @@ void HelpWriterContext::Impl::processMarkup(const std::string &text,
         {
             result = repall(result, sandrRst);
             result = replaceLinks(result);
+            result = replaceAll(result, "[REF]", "");
+            result = replaceAll(result, "[ref]", "");
             return wrapper->wrap(result);
         }
         default: