+ ConfigTag* tag = i->second;
+
+ // Attempt to read the help key.
+ const std::string key = tag->getString("key");
+ if (key.empty())
+ throw ModuleException(InspIRCd::Format("<helpop:key> is empty at %s", tag->getTagLocation().c_str()));
+ else if (irc::equals(key, "index"))
+ throw ModuleException(InspIRCd::Format("<helpop:key> is set to \"index\" which is reserved at %s", tag->getTagLocation().c_str()));
+ else if (key.length() > longestkey)
+ longestkey = key.length();
+
+ // Attempt to read the help value.
+ std::string value;
+ if (!tag->readString("value", value, true) || value.empty())
+ throw ModuleException(InspIRCd::Format("<helpop:value> is empty at %s", tag->getTagLocation().c_str()));
+
+ // Parse the help body. Empty lines are replaced with a single
+ // space because some clients are unable to show blank lines.
+ HelpMessage helpmsg;
+ irc::sepstream linestream(value, '\n', true);
+ for (std::string line; linestream.GetToken(line); )
+ helpmsg.push_back(line.empty() ? " " : line);
+ newhelp[key] = helpmsg;