aboutsummaryrefslogtreecommitdiffstats
path: root/library/cpp/html
diff options
context:
space:
mode:
authoryazevnul <yazevnul@yandex-team.ru>2022-02-10 16:46:46 +0300
committerDaniil Cherednik <dcherednik@yandex-team.ru>2022-02-10 16:46:46 +0300
commit8cbc307de0221f84c80c42dcbe07d40727537e2c (patch)
tree625d5a673015d1df891e051033e9fcde5c7be4e5 /library/cpp/html
parent30d1ef3941e0dc835be7609de5ebee66958f215a (diff)
downloadydb-8cbc307de0221f84c80c42dcbe07d40727537e2c.tar.gz
Restoring authorship annotation for <yazevnul@yandex-team.ru>. Commit 1 of 2.
Diffstat (limited to 'library/cpp/html')
-rw-r--r--library/cpp/html/escape/ut/escape_ut.cpp4
-rw-r--r--library/cpp/html/pcdata/pcdata.cpp2
-rw-r--r--library/cpp/html/pcdata/pcdata.h2
-rw-r--r--library/cpp/html/pcdata/pcdata_ut.cpp14
4 files changed, 11 insertions, 11 deletions
diff --git a/library/cpp/html/escape/ut/escape_ut.cpp b/library/cpp/html/escape/ut/escape_ut.cpp
index cd7b955138..7a28d7c12b 100644
--- a/library/cpp/html/escape/ut/escape_ut.cpp
+++ b/library/cpp/html/escape/ut/escape_ut.cpp
@@ -3,8 +3,8 @@
using namespace NHtml;
-Y_UNIT_TEST_SUITE(TEscapeHtml) {
- Y_UNIT_TEST(Escape) {
+Y_UNIT_TEST_SUITE(TEscapeHtml) {
+ Y_UNIT_TEST(Escape) {
UNIT_ASSERT_EQUAL(EscapeText("in & out"), "in &amp; out");
UNIT_ASSERT_EQUAL(EscapeText("&&"), "&amp;&amp;");
UNIT_ASSERT_EQUAL(EscapeText("&amp;"), "&amp;amp;");
diff --git a/library/cpp/html/pcdata/pcdata.cpp b/library/cpp/html/pcdata/pcdata.cpp
index 740c240fd2..7cc0f6da85 100644
--- a/library/cpp/html/pcdata/pcdata.cpp
+++ b/library/cpp/html/pcdata/pcdata.cpp
@@ -61,7 +61,7 @@ TString EncodeHtmlPcdata(const TStringBuf str, bool qAmp) {
TString DecodeHtmlPcdata(const TString& sz) {
TString res;
- const char* codes[] = {"&quot;", "&lt;", "&gt;", "&#39;", "&#039;", "&amp;", "&apos;", nullptr};
+ const char* codes[] = {"&quot;", "&lt;", "&gt;", "&#39;", "&#039;", "&amp;", "&apos;", nullptr};
const char chars[] = {'\"', '<', '>', '\'', '\'', '&', '\''};
for (size_t i = 0; i < sz.length(); ++i) {
char c = sz[i];
diff --git a/library/cpp/html/pcdata/pcdata.h b/library/cpp/html/pcdata/pcdata.h
index 7dd741f53d..786e98ac02 100644
--- a/library/cpp/html/pcdata/pcdata.h
+++ b/library/cpp/html/pcdata/pcdata.h
@@ -1,6 +1,6 @@
#pragma once
-#include <util/generic/fwd.h>
+#include <util/generic/fwd.h>
/// Converts a text into HTML-code. Special characters of HTML («<», «>», ...) replaced with entities.
TString EncodeHtmlPcdata(const TStringBuf str, bool qAmp = true);
diff --git a/library/cpp/html/pcdata/pcdata_ut.cpp b/library/cpp/html/pcdata/pcdata_ut.cpp
index 5833f8bc59..90088712e2 100644
--- a/library/cpp/html/pcdata/pcdata_ut.cpp
+++ b/library/cpp/html/pcdata/pcdata_ut.cpp
@@ -2,8 +2,8 @@
#include <library/cpp/testing/unittest/registar.h>
-Y_UNIT_TEST_SUITE(TPcdata) {
- Y_UNIT_TEST(TestStress) {
+Y_UNIT_TEST_SUITE(TPcdata) {
+ Y_UNIT_TEST(TestStress) {
{
ui64 key = 0x000017C0B76C4E87ull;
TString res = EncodeHtmlPcdata(TStringBuf((const char*)&key, sizeof(key)));
@@ -16,23 +16,23 @@ Y_UNIT_TEST_SUITE(TPcdata) {
}
}
- Y_UNIT_TEST(Test1) {
+ Y_UNIT_TEST(Test1) {
const TString tests[] = {
"qw&qw",
"&<",
">&qw",
"\'&aaa"};
- for (auto s : tests) {
+ for (auto s : tests) {
UNIT_ASSERT_VALUES_EQUAL(DecodeHtmlPcdata(EncodeHtmlPcdata(s)), s);
}
}
- Y_UNIT_TEST(Test2) {
+ Y_UNIT_TEST(Test2) {
UNIT_ASSERT_VALUES_EQUAL(EncodeHtmlPcdata("&qqq"), "&amp;qqq");
}
- Y_UNIT_TEST(TestEncodeHtmlPcdataAppend) {
+ Y_UNIT_TEST(TestEncodeHtmlPcdataAppend) {
TString s;
EncodeHtmlPcdataAppend("m&m", s);
EncodeHtmlPcdataAppend("'s", s);
@@ -40,7 +40,7 @@ Y_UNIT_TEST_SUITE(TPcdata) {
UNIT_ASSERT_VALUES_EQUAL("m&amp;m&#39;s", s);
}
- Y_UNIT_TEST(TestStrangeAmpParameter) {
+ Y_UNIT_TEST(TestStrangeAmpParameter) {
UNIT_ASSERT_VALUES_EQUAL(EncodeHtmlPcdata("m&m's", true), "m&amp;m&#39;s");
UNIT_ASSERT_VALUES_EQUAL(EncodeHtmlPcdata("m&m's"), "m&amp;m&#39;s"); //default
UNIT_ASSERT_VALUES_EQUAL(EncodeHtmlPcdata("m&m's", false), "m&m&#39;s");