{"name":"postcss-markdown","version":"2.0.0","publishConfig":{"access":"public"},"description":"PostCSS syntax for parsing Markdown","engines":{"node":"^22.12 || >=24"},"type":"module","main":"./lib/index.js","exports":{".":"./lib/index.js","./package.json":"./package.json"},"repository":{"type":"git","url":"git+https://github.com/ota-meshi/postcss-markdown.git"},"keywords":["postcss","syntax","markdown","html","css","less","sass","scss","sss","sugarss"],"author":{"name":"gucong"},"contributors":[{"name":"Yosuke Ota","url":"https://github.com/ota-meshi"}],"license":"MIT","bugs":{"url":"https://github.com/ota-meshi/postcss-markdown/issues"},"homepage":"https://github.com/ota-meshi/postcss-markdown#readme","scripts":{"mocha":"mocha \"test/**/*.js\" --no-timeouts","test":"c8 npm run mocha","lint":"eslint .","eslint-fix":"eslint . --fix","preversion":"npm run test","update-snap":"mocha \"test/**/*.js\" --no-timeouts --update"},"dependencies":{"mdast-util-from-markdown":"^2.0.3","mdast-util-frontmatter":"^2.0.1","micromark-extension-frontmatter":"^2.0.0","postcss-safe-parser":"^7.0.1"},"peerDependencies":{"postcss":"^8.5.0"},"devDependencies":{"@ota-meshi/eslint-plugin":"^0.13.0","autoprefixer":"^10.3.7","c8":"^12.0.0","chai":"^6.0.0","codecov":"^3.8.1","eslint":"^8.0.0","eslint-config-prettier":"^10.0.0","eslint-plugin-eslint-comments":"^3.2.0","eslint-plugin-json-schema-validator":"^5.0.0","eslint-plugin-jsonc":"^2.0.0","eslint-plugin-node":"^11.1.0","eslint-plugin-node-dependencies":"^0.13.0","eslint-plugin-prettier":"^5.0.0","eslint-plugin-regexp":"^1.4.1","eslint-plugin-yml":"^1.0.0","mocha":"^10.0.0","mocha-chai-jest-snapshot":"1.1.7","postcss":"^8.5.0","postcss-html":"^1.3.0","postcss-less":"^6.0.0","postcss-scss":"^4.0.0","postcss-styl":"^0.12.0","prettier":"^3.0.0","stylelint":"^14.4.0","stylelint-config-standard":"^29.0.0","sugarss":"^4.0.0"},"gitHead":"77254eb3507d8403e37befded3a6df9e258bc1a1","_id":"postcss-markdown@2.0.0","_nodeVersion":"24.18.0","_npmVersion":"11.16.0","dist":{"integrity":"sha512-O1mLfXYuxUXL2PcpTGE6dl2VnYHxjxzU9eYw5s0iIsk5RCKCEkcSCNEZF9ujHadTfOf9Wp6jfMIMUW/nPrMTjg==","shasum":"a2e49459a7578d26b757d8ed91fc05624441d6cc","tarball":"http://registry-npm.ywwl.com/postcss-markdown/download/postcss-markdown-2.0.0.tgz","fileCount":11,"unpackedSize":30535,"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/postcss-markdown@2.0.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIFT+PX8gGf8eg2EM3eug6RpLYM0ILOfO27cDYgpsqdnXAiBXVObFfkk4LsYB8GmmeWDtzAQniWHIy4adtEsD+dGSOQ=="}],"size":9761,"noattachment":false,"key":"/postcss-markdown/-/postcss-markdown-2.0.0.tgz"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:5bd476b3-98d7-444a-a28f-95ffd6bdab81"}},"directories":{},"maintainers":[{"name":"jeddy3","email":"npm@richardhallows.com"},{"name":"ai","email":"andrey@sitnik.es"},{"name":"gucong","email":"gucong@gmail.com"},{"name":"ota-meshi","email":"otameshiyo23@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/postcss-markdown_2.0.0_1785545939469_0.22738959788478663"},"_hasShrinkwrap":false,"readme":"# PostCSS Markdown Syntax\n\n[![NPM license](https://img.shields.io/npm/l/postcss-markdown.svg)](https://www.npmjs.com/package/postcss-markdown)\n[![NPM version](https://img.shields.io/npm/v/postcss-markdown.svg?style=flat-square)](https://www.npmjs.com/package/postcss-markdown)\n[![NPM downloads](https://img.shields.io/npm/dw/postcss-markdown.svg)](http://www.npmtrends.com/postcss-markdown)\n[![NPM downloads](https://img.shields.io/npm/dm/postcss-markdown.svg)](http://www.npmtrends.com/postcss-markdown)\n[![NPM downloads](https://img.shields.io/npm/dy/postcss-markdown.svg)](http://www.npmtrends.com/postcss-markdown)\n[![Build Status](https://github.com/ota-meshi/postcss-markdown/workflows/CI/badge.svg?branch=master)](https://github.com/ota-meshi/postcss-markdown/actions?query=workflow%3ACI)\n\n<img align=\"right\" width=\"95\" height=\"95\"\n title=\"Philosopher’s stone, logo of PostCSS\"\n src=\"http://postcss.github.io/postcss/logo.svg\">\n\n[PostCSS](https://github.com/postcss/postcss) syntax for parsing [Markdown](https://daringfireball.net/projects/markdown/syntax)\n\n## Getting Started\n\nFirst thing's first, install the module:\n\n```bash\nnpm install postcss-markdown --save-dev\n```\n\nIf you want support SCSS/SASS/LESS/SugarSS syntax, you need to install the corresponding module.\n\n- SCSS: [postcss-scss](https://github.com/postcss/postcss-scss)\n- SASS: [postcss-sass](https://github.com/aleshaoleg/postcss-sass)\n- LESS: [postcss-less](https://github.com/shellscape/postcss-less)\n- SugarSS: [sugarss](https://github.com/postcss/sugarss)\n- Stylus: [postcss-styl](https://github.com/ota-meshi/postcss-styl)\n\nThis package is written in ESM and requires Node.js `^22.12 || >=24`. CommonJS consumers can still load it with `require(\"postcss-markdown\")` on these Node.js versions (via `require(esm)`).\n\n## Use Cases\n\n```js\nimport postcss from \"postcss\";\nimport postcssMarkdown from \"postcss-markdown\";\nimport postcssScss from \"postcss-scss\";\nimport postcssLess from \"postcss-less\";\nimport postcssSafeParser from \"postcss-safe-parser\";\nimport autoprefixer from \"autoprefixer\";\n\nconst syntax = postcssMarkdown({\n    // Enable support for HTML (default: true)\n    htmlInMd: true,\n    // syntax for parse scss (non-required options)\n    scss: postcssScss,\n    // syntax for parse less (non-required options)\n    less: postcssLess,\n    // syntax for parse css blocks (non-required options)\n    css: postcssSafeParser,\n});\npostcss([autoprefixer])\n    .process(source, { syntax: syntax })\n    .then(function (result) {\n        // An alias for the result.css property. Use it with syntaxes that generate non-CSS output.\n        result.content;\n    });\n```\n\ninput:\n\n<pre><code># title\n\n```css\n::placeholder {\n    color: gray;\n}\n```\n</code></pre>\n\noutput:\n\n<pre><code># title\n\n```css\n::-moz-placeholder {\n    color: gray;\n}\n:-ms-input-placeholder {\n    color: gray;\n}\n::placeholder {\n    color: gray;\n}\n```\n</code></pre>\n\nIf you want support SCSS/SASS/LESS/SugarSS syntax, you need to install these module:\n\n- SCSS: [postcss-scss](https://github.com/postcss/postcss-scss)\n- SASS: [postcss-sass](https://github.com/aleshaoleg/postcss-sass)\n- LESS: [postcss-less](https://github.com/shellscape/postcss-less)\n- SugarSS: [sugarss](https://github.com/postcss/sugarss)\n- Stylus: [postcss-styl](https://github.com/ota-meshi/postcss-styl)\n\n## Advanced Use Cases\n\n### Options\n\n```js\nimport { createRequire } from \"module\";\nimport postcssMarkdown from \"postcss-markdown\";\nimport postcssSass from \"postcss-sass\";\nimport sugarss from \"sugarss\";\nimport postcssCustomSyntax from \"postcss-custom-syntax\";\n\nconst options = {\n    rules: [\n        {\n            // custom language\n            test: /^postcss$/i,\n            lang: \"scss\",\n        },\n        {\n            // custom language\n            test: /^customcss$/i,\n            lang: \"custom\",\n        },\n    ],\n\n    // custom parser for CSS (using `postcss-safe-parser`)\n    css: \"postcss-safe-parser\",\n    // custom parser for SASS (PostCSS-compatible syntax.)\n    sass: postcssSass,\n    // custom parser for SCSS (by module name)\n    scss: \"postcss-scss\",\n    // custom parser for LESS (by module path)\n    less: createRequire(import.meta.url).resolve(\"postcss-less\"),\n    // custom parser for SugarSS\n    sugarss: sugarss,\n    // custom parser for custom language\n    custom: postcssCustomSyntax,\n};\nconst syntax = postcssMarkdown(options);\n```\n\n## Turning PostCSS off from within your Markdown\n\nPostCSS can be temporarily turned off by using special comments in your Markdown. For example:\n\n<pre><code>&lt;!-- postcss-ignore -->\n```css\na {\n    color: red;\n}\n```\n</code></pre>\n\n## Linting with Stylelint\n\nThe main use case of this plugin is to apply linting with [Stylelint] to CSS (and CSS-like) code blocks in markdown file.\n\nYou can use it by configuring your `stylelint` config as follows:\n\n```json\n{\n    \"overrides\": [\n        {\n            \"files\": [\"*.md\", \"**/*.md\"],\n            \"customSyntax\": \"postcss-markdown\"\n        }\n    ]\n}\n```\n\n[stylelint]: https://stylelint.io/\n\n### Editor integrations\n\n#### Visual Studio Code\n\nUse the [stylelint.vscode-stylelint](https://marketplace.visualstudio.com/items?itemName=stylelint.vscode-stylelint) extension that [Stylelint] provides officially.\n\nYou have to configure the `stylelint.validate` option of the extension to check `.md` files, because the extension does not check the `*.md` file by default.\n\nExample **.vscode/settings.json**:\n\n```jsonc\n{\n  \"stylelint.validate\": [\n      ...,\n      // ↓ Add \"markdown\" language.\n      \"markdown\"\n  ]\n```\n\n","publish_time":1785545939613,"_cnpm_publish_time":1785545939613,"dist-tags":{"latest":"2.0.0","next":"1.0.0-beta.2"}}