1
0
mirror of https://github.com/rkd77/elinks.git synced 2025-02-02 15:09:23 -05:00

[css2xpath] added test case and fix

This commit is contained in:
Witold Filipczyk 2021-10-05 21:43:23 +02:00
parent b84cfb1360
commit 7cfca54b59

View File

@ -296,6 +296,9 @@ class Translator
selector = r->apply(selector);
}
std::string quotes("\"\"");
selector = preg_replace(quotes, "\"", selector);
return selector == "/" ? "/" : ("//" + selector);
}
@ -487,7 +490,8 @@ tests()
{"input:disabled", "//input[@disabled]"},
{":empty", "//*[not(*) and not(normalize-space())]"},
{":root", "/"}
{":root", "/"},
{"meta[name=\"gaf\"]", "//meta[@name=\"gaf\"]"}
};
for (auto t: provider)