We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
A font shorthand declaration is not parsed correctly if it contains a numerical font-weight.
font
font-weight
var p = new HtmlParser(new HtmlParserOptions(), BrowsingContext.New(new Configuration().WithCss(new CssParserOptions()))); var dom = p.ParseDocument(@"<html><body><div style=""font: 400 12px serif"">Test</div></body></html>"); var div = dom.QuerySelector("div"); var style = div.GetStyle(); // -> style.Length == 0 var css = style.CssText; // -> ""
It works if font-weight is specified using a constant, e.g. font: bold 12px serif.
font: bold 12px serif
It seems the numerical case is not considered here:
AngleSharp.Css/src/AngleSharp.Css/Declarations/FontDeclaration.cs
Lines 61 to 65 in e59a6e7
The text was updated successfully, but these errors were encountered:
Yes I guess that's right. Can you supply a PR?
Thanks - much appreciated! 🍻
Sorry, something went wrong.
Fix AngleSharp#56
e6fe86d
Available in 0.14.2!
No branches or pull requests
Description
A
font
shorthand declaration is not parsed correctly if it contains a numericalfont-weight
.Steps to Reproduce
It works if
font-weight
is specified using a constant, e.g.font: bold 12px serif
.Possible Solution
It seems the numerical case is not considered here:
AngleSharp.Css/src/AngleSharp.Css/Declarations/FontDeclaration.cs
Lines 61 to 65 in e59a6e7
The text was updated successfully, but these errors were encountered: