diff options
Diffstat (limited to 'src/libserver/css')
-rw-r--r-- | src/libserver/css/css.cxx | 19 | ||||
-rw-r--r-- | src/libserver/css/css_parser.cxx | 4 | ||||
-rw-r--r-- | src/libserver/css/css_selector.cxx | 4 | ||||
-rw-r--r-- | src/libserver/css/css_value.cxx | 4 |
4 files changed, 12 insertions, 19 deletions
diff --git a/src/libserver/css/css.cxx b/src/libserver/css/css.cxx index 1b369ed17..c53e3c05e 100644 --- a/src/libserver/css/css.cxx +++ b/src/libserver/css/css.cxx @@ -1,11 +1,11 @@ -/*- - * Copyright 2021 Vsevolod Stakhov +/* + * Copyright 2025 Vsevolod Stakhov * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -107,7 +107,6 @@ auto css_style_sheet::add_selector_rule(std::unique_ptr<css_selector> &&selector auto css_style_sheet::check_tag_block(const rspamd::html::html_tag *tag) -> rspamd::html::html_block * { - std::optional<std::string_view> id_comp, class_comp; rspamd::html::html_block *res = nullptr; if (!tag) { @@ -115,14 +114,8 @@ auto css_style_sheet::check_tag_block(const rspamd::html::html_tag *tag) -> rspa } /* First, find id in a tag and a class */ - for (const auto ¶m: tag->components) { - if (param.type == html::html_component_type::RSPAMD_HTML_COMPONENT_ID) { - id_comp = param.value; - } - else if (param.type == html::html_component_type::RSPAMD_HTML_COMPONENT_CLASS) { - class_comp = param.value; - } - } + auto id_comp = tag->find_id(); + auto class_comp = tag->find_class(); /* ID part */ if (id_comp && !pimpl->id_selectors.empty()) { @@ -224,4 +217,4 @@ auto css_parse_style(rspamd_mempool_t *pool, return std::make_pair(nullptr, parse_res.error()); } -}// namespace rspamd::css
\ No newline at end of file +}// namespace rspamd::css diff --git a/src/libserver/css/css_parser.cxx b/src/libserver/css/css_parser.cxx index 11fa830f0..ade499ba4 100644 --- a/src/libserver/css/css_parser.cxx +++ b/src/libserver/css/css_parser.cxx @@ -1,5 +1,5 @@ /* - * Copyright 2024 Vsevolod Stakhov + * Copyright 2025 Vsevolod Stakhov * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -20,7 +20,7 @@ #include "css_rule.hxx" #include "css_util.hxx" #include "css.hxx" -#include "fmt/base.h" +#include "contrib/fmt/include/fmt/base.h" #include <vector> #include <unicode/utf8.h> diff --git a/src/libserver/css/css_selector.cxx b/src/libserver/css/css_selector.cxx index d2ae093cb..527b12377 100644 --- a/src/libserver/css/css_selector.cxx +++ b/src/libserver/css/css_selector.cxx @@ -1,5 +1,5 @@ /* - * Copyright 2024 Vsevolod Stakhov + * Copyright 2025 Vsevolod Stakhov * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -17,7 +17,7 @@ #include "css_selector.hxx" #include "css.hxx" #include "libserver/html/html.hxx" -#include "fmt/base.h" +#include "contrib/fmt/include/fmt/base.h" #define DOCTEST_CONFIG_IMPLEMENTATION_IN_DLL #include "doctest/doctest.h" diff --git a/src/libserver/css/css_value.cxx b/src/libserver/css/css_value.cxx index f2ff55363..52a61d3b6 100644 --- a/src/libserver/css/css_value.cxx +++ b/src/libserver/css/css_value.cxx @@ -1,5 +1,5 @@ /* - * Copyright 2024 Vsevolod Stakhov + * Copyright 2025 Vsevolod Stakhov * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -20,7 +20,7 @@ #include "frozen/string.h" #include "libutil/util.h" #include "contrib/ankerl/unordered_dense.h" -#include "fmt/base.h" +#include "contrib/fmt/include/fmt/base.h" #define DOCTEST_CONFIG_IMPLEMENTATION_IN_DLL #include "doctest/doctest.h" |