Skip to content

Missing semicolons in @page rule #135

New issue

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

Closed
mganss opened this issue Mar 7, 2023 · 6 comments
Closed

Missing semicolons in @page rule #135

mganss opened this issue Mar 7, 2023 · 6 comments
Labels
Milestone

Comments

@mganss
Copy link
Contributor

mganss commented Mar 7, 2023

var html = "<html><body><style>@page { margin: 25mm }</style></body></html>";
var parser = new HtmlParser(new HtmlParserOptions(), BrowsingContext.New(Configuration.Default.WithCss(new CssParserOptions())));
var dom = parser.ParseDocument(html);
var styleSheet = dom.StyleSheets.OfType<ICssStyleSheet>().First();
var css = styleSheet.ToCss(); // -> "@page { margin-top: 25mm margin-right: 25mm margin-bottom: 25mm margin-left: 25mm }"

This was originally reported as mganss/HtmlSanitizer#438.

@FlorianRappl
Copy link
Contributor

CSS is not part of AngleSharp.Core.

@HWouters
Copy link

HWouters commented Mar 7, 2023

CssStyleFormatter.cs is part of this repository, isn't it?

@FlorianRappl
Copy link
Contributor

CssStyleFormatter.cs is part of this repository, isn't it?

Yes, and? The issue seems to be in the serialization of the specific rule, not of a stylesheets in general. That makes a huge difference. The style formatter (as any formatter) does not know or need to know rules and their internals. It does not serialize declarations or rules.

@mganss
Copy link
Contributor Author

mganss commented Mar 9, 2023

@FlorianRappl Will you transfer the issue or shall I open a new one in AngleSharp.Css?

@FlorianRappl FlorianRappl transferred this issue from AngleSharp/AngleSharp Mar 9, 2023
@FlorianRappl FlorianRappl added bug and removed invalid labels Mar 9, 2023
@FlorianRappl FlorianRappl reopened this Mar 9, 2023
@FlorianRappl
Copy link
Contributor

Thanks for the reminder @mganss - a transfer makes sense. Transferred!

@FlorianRappl FlorianRappl added this to the v1.0 milestone Jun 14, 2023
@FlorianRappl
Copy link
Contributor

Implemented and ready for the next preview / 1.0.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants