Skip to content
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

Properties in @font-face declaration are removed (font-display, mso-generic-font-family, mso-font-alt) #541

Open
maryia-kabash opened this issue Apr 3, 2024 · 1 comment

Comments

@maryia-kabash
Copy link

Hello,
I have a question on how to allow specific properties for @​font-face declaration (font-face is added to AllowedAtRules).

font-display, mso-generic-font-family, mso-font-alt are removed (adding them to AllowedCssProperties does not help because they are descriptors, not exactly CSS properties).

Maybe I am missing something with Sanitizer set up? Thanks!

Example input:

@​font-face {
    font-family: "FontName";
    src: url("https://path-to-file.woff") format("woff");
    font-display: swap;
    mso-generic-font-family: swiss;
    mso-font-alt: 'Calibri';
}

Output:

@​font-face {
    font-family: "FontName";
    src: url("https://path-to-file.woff") format("woff");
}
@maryia-kabash
Copy link
Author

I believe the root cause is inside AngleSharp as it does not have these declarations listed here:
https://github.com/AngleSharp/AngleSharp.Css/blob/devel/src/AngleSharp.Css/Dom/ICssFontFaceRule.cs

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

No branches or pull requests

1 participant