![Create React App Officially Deprecated Amid React 19 Compatibility Issues](https://cdn.sanity.io/images/cgdhsj6q/production/04fa08cf844d798abc0e1a6391c129363cc7e2ab-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Create React App Officially Deprecated Amid React 19 Compatibility Issues
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
postcss-markdown
Advanced tools
PostCSS syntax for parsing Markdown
First thing's first, install the module:
npm install postcss-markdown@next --save-dev
If you want support SCSS/SASS/LESS/SugarSS syntax, you need to install the corresponding module.
const postcss = require("postcss");
const syntax = require("postcss-markdown")({
// Enable support for HTML (default: true)
htmlInMd: true,
// syntax for parse scss (non-required options)
scss: require("postcss-scss"),
// syntax for parse less (non-required options)
less: require("postcss-less"),
// syntax for parse css blocks (non-required options)
css: require("postcss-safe-parser"),
});
const autoprefixer = require("autoprefixer");
postcss([autoprefixer])
.process(source, { syntax: syntax })
.then(function (result) {
// An alias for the result.css property. Use it with syntaxes that generate non-CSS output.
result.content;
});
input:
# title
```css
::placeholder {
color: gray;
}
```
output:
# title
```css
::-moz-placeholder {
color: gray;
}
:-ms-input-placeholder {
color: gray;
}
::placeholder {
color: gray;
}
```
If you want support SCSS/SASS/LESS/SugarSS syntax, you need to install these module:
const options = {
rules: [
{
// custom language
test: /^postcss$/i,
lang: "scss",
},
{
// custom language
test: /^customcss$/i,
lang: "custom",
},
],
// custom parser for CSS (using `postcss-safe-parser`)
css: "postcss-safe-parser",
// custom parser for SASS (PostCSS-compatible syntax.)
sass: require("postcss-sass"),
// custom parser for SCSS (by module name)
scss: "postcss-scss",
// custom parser for LESS (by module path)
less: require.resolve("./node_modules/postcss-less"),
// custom parser for SugarSS
sugarss: require("sugarss"),
// custom parser for custom language
custom: require("postcss-custom-syntax"),
};
const syntax = require("postcss-markdown")(options);
PostCSS can be temporarily turned off by using special comments in your Markdown. For example:
<!-- postcss-ignore -->
```css
a {
color: red;
}
```
The main use case of this plugin is to apply linting with Stylelint to CSS (and CSS-like) code blocks in markdown file.
You can use it by configuring your stylelint
config as follows:
{
"overrides": [
{
"files": ["*.md", "**/*.md"],
"customSyntax": "postcss-markdown"
}
]
}
Use the stylelint.vscode-stylelint extension that Stylelint provides officially.
You 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.
Example .vscode/settings.json:
{
"stylelint.validate": [
...,
// ↓ Add "markdown" language.
"markdown"
]
FAQs
PostCSS syntax for parsing Markdown
The npm package postcss-markdown receives a total of 0 weekly downloads. As such, postcss-markdown popularity was classified as not popular.
We found that postcss-markdown demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 4 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.