Fixed appending eof character #123
This commit is contained in:
Родитель
3b89d01339
Коммит
b9aef4c457
|
@ -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("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++;
|
||||
|
|
Загрузка…
Ссылка в новой задаче