Add rel and rel_stylesheet into HTMLTag.

This commit is contained in:
Relintai 2020-12-26 00:17:59 +01:00
parent 8f5c1fa4cc
commit 7e24a87c57
2 changed files with 14 additions and 0 deletions

View File

@ -46,6 +46,18 @@ HTMLTag *HTMLTag::type(const std::string &val) {
return this;
}
HTMLTag *HTMLTag::rel(const std::string &val) {
attrib("rel", val);
return this;
}
HTMLTag *HTMLTag::rel_stylesheet() {
attrib("rel", "stylesheet");
return this;
}
HTMLTag *HTMLTag::attrib(const std::string &attr, const std::string &val) {
result += " " + attr + "=\"" + val + "\"";

View File

@ -22,6 +22,8 @@ public:
HTMLTag *name(const std::string &val);
HTMLTag *method(const std::string &val);
HTMLTag *type(const std::string &val);
HTMLTag *rel(const std::string &val);
HTMLTag *rel_stylesheet();
HTMLTag *attrib(const std::string &attr, const std::string &val);