Skip to content

removeQuotes error for minifyFontValues. #430

@septs

Description

@septs

Steps to reproduce

const postcss = require("postcss");
async function main() {
  const plugins = [require("postcss-minify-font-values")];
  const input = 'body { font-family: "STHeiti Light [STXihei]" }';
  console.log("/* Input: */\n%s", input);
  const output = await postcss(plugins).process(input);
  console.log("/* Output: */\n%s", output.css);
}
main();

Actual behavior

/* Input: */
body { font-family: "STHeiti Light [STXihei]" }
/* Output: */
body { font-family: STHeiti Light\ [STXihei] }

Output is Invaild property value

Expected behavior

/* Input: */
body { font-family: "STHeiti Light [STXihei]" }
/* Output: */
body { font-family: STHeiti Light \[STXihei\] }

Reference

  1. https://drafts.csswg.org/css-fonts-3/#font-family-prop
  2. https://www.w3.org/TR/CSS22/syndata.html#strings
  3. https://www.w3.org/TR/CSS22/syndata.html#escaped-characters
  4. https://www.w3.org/TR/CSS22/syndata.html#tokenization
  5. https://github.com/ben-eb/cssnano/blob/77a8889fb500c1579740421d48d72bd2549b0f40/packages/postcss-minify-font-values/src/lib/minify-family.js

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions