This commit is contained in:
Florian Rappl 2023-06-14 14:41:00 +02:00
Родитель 3b89d01339
Коммит b9aef4c457
3 изменённых файлов: 40 добавлений и 0 удалений

Просмотреть файл

@ -4,6 +4,7 @@ Released on tbd.
- Updated to use AngleSharp 1.0
- Fixed issue when updating shorthands with invalid values (#129)
- Fixed issue with appended EOF character in `CssText` (#123)
# 0.17.0

Просмотреть файл

@ -106,6 +106,40 @@ namespace AngleSharp.Css.Tests.Library
Assert.AreEqual(css, generatedCss);
}
[Test]
public void CssTextShouldNotAddReplacementCharacter_Issue123()
{
var html = @"<span style=""background-image: var(--urlSpellingErrorV2,url(&quot;https://www.example.com/))"">Ipsum</span>";
var dom = html.ToHtmlDocument(Configuration.Default.WithCss(new CssParserOptions
{
IsIncludingUnknownDeclarations = true,
IsIncludingUnknownRules = true,
IsToleratingInvalidSelectors = true,
}));
var div = dom.Body?.FirstElementChild;
var style = div.GetStyle();
var css = style.ToCss();
Assert.AreEqual("background-image: var(--urlSpellingErrorV2,url(\"https://www.example.com/))", css);
}
[Test]
public void CssTextShouldNotTrailingSemicolonCharacter_Issue123()
{
var html = @"<span style=""color: red;"">Ipsum</span>";
var dom = html.ToHtmlDocument(Configuration.Default.WithCss(new CssParserOptions
{
IsIncludingUnknownDeclarations = true,
IsIncludingUnknownRules = true,
IsToleratingInvalidSelectors = true,
}));
var div = dom.Body?.FirstElementChild;
var style = div.GetStyle();
var css = style.ToCss();
Assert.AreEqual("color: rgba(255, 0, 0, 1)", css);
}
[Test]
public void BorderWithEmptyPx_Issue129()
{

Просмотреть файл

@ -70,6 +70,11 @@ namespace AngleSharp.Css.Parser
{
var token = Data(current);
if (Current is Symbols.EndOfFile)
{
Back();
}
if (token.Type == CssTokenType.Whitespace)
{
spaced++;