diff options
-rw-r--r-- | http/utility.h | 17 |
1 files changed, 5 insertions, 12 deletions
diff --git a/http/utility.h b/http/utility.h index ee88e5a..c71187d 100644 --- a/http/utility.h +++ b/http/utility.h @@ -738,18 +738,11 @@ inline void escapeHtml(std::string& data) inline void convertToLinks(std::string& s) { - const static std::regex r{"("@odata\\.((id)|(Context))"[ \\n]*:[ " - "\\n]*)("((?!").*)")"}; - s = std::regex_replace(s, r, "$1<a href=\"$6\">$5</a>"); - - const static std::regex nextLink{ - "("Members@odata\\.((nextLink))"[ \\n]*:[ " - "\\n]*)("((?!").*)")"}; - s = std::regex_replace(s, nextLink, "$1<a href=\"$5\">$4</a>"); - - const static std::regex uri{"("((Uri))"[ \\n]*:[ " - "\\n]*)("((?!").*)")"}; - s = std::regex_replace(s, uri, "$1<a href=\"$5\">$4</a>"); + // Convert anything with a redfish path into a link + const static std::regex redfishPath{ + "("((.*))"[ \\n]*:[ " + "\\n]*)("((?!")/redfish/.*)")"}; + s = std::regex_replace(s, redfishPath, "$1<a href=\"$5\">$4</a>"); } /** |