Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Support acss in alipay (#25)
  • Loading branch information
gucong3000 committed Mar 9, 2018
1 parent 65cd074 commit a5cd2d7
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 9 deletions.
1 change: 1 addition & 0 deletions README.md
Expand Up @@ -4,6 +4,7 @@ PostCSS HTML Syntax
[![NPM version](https://img.shields.io/npm/v/postcss-html.svg?style=flat-square)](https://www.npmjs.com/package/postcss-html)
[![Travis](https://img.shields.io/travis/gucong3000/postcss-html.svg)](https://travis-ci.org/gucong3000/postcss-html)
[![Codecov](https://img.shields.io/codecov/c/github/gucong3000/postcss-html.svg)](https://codecov.io/gh/gucong3000/postcss-html)
[![David](https://img.shields.io/david/gucong3000/postcss-html.svg)](https://david-dm.org/gucong3000/postcss-html)

<img align="right" width="95" height="95"
title="Philosopher’s stone, logo of PostCSS"
Expand Down
2 changes: 1 addition & 1 deletion lib/parser.js
Expand Up @@ -11,7 +11,7 @@ function parser (source, opts) {
return opts.from && reg.test(opts.from);
}
// Skip known style sheet files.
if (filenameMatch(/\.(?:(?:p(?:ost)?)?css|(?:wx|le|sa|sc|s)ss|styl(?:us)?)(?:\?.+)?$/i)) {
if (filenameMatch(/\.(?:(?:\w*c|wx|le|sa|s)ss|styl(?:us)?)(?:\?.+)?$/i)) {
return;
}

Expand Down
10 changes: 5 additions & 5 deletions package.json
@@ -1,6 +1,6 @@
{
"name": "postcss-html",
"version": "0.13.0",
"version": "0.14.0",
"description": "PostCSS Syntax for parsing HTML / Markdown / Vue Component",
"main": "lib/index.js",
"scripts": {
Expand Down Expand Up @@ -53,7 +53,7 @@
"postcss": ">=5.0.0",
"postcss-less": ">=1.1.0",
"postcss-safe-parser": ">=3.0.0",
"postcss-sass": ">=0.2.0",
"postcss-sass": ">=0.3.0",
"postcss-scss": ">=1.0.0",
"sugarss": ">=1.0.0"
},
Expand All @@ -65,13 +65,13 @@
"eslint-config-standard": "^11.0.0",
"eslint-plugin-import": "^2.9.0",
"eslint-plugin-node": "^6.0.1",
"eslint-plugin-promise": "^3.6.0",
"eslint-plugin-promise": "^3.7.0",
"eslint-plugin-standard": "^3.0.1",
"mocha": "^5.0.2",
"mocha": "^5.0.4",
"nyc": "^11.4.1",
"postcss": "^6.0.19",
"postcss-less": "^1.1.3",
"postcss-parser-tests": "^6.2.0",
"postcss-parser-tests": "^6.2.1",
"postcss-safe-parser": "^3.0.1",
"postcss-sass": "^0.3.0",
"postcss-scss": "^1.0.4",
Expand Down
25 changes: 22 additions & 3 deletions test/index.js
Expand Up @@ -118,7 +118,7 @@ describe("API", () => {
}).to.throw("custom parse error");
});

it("Not parse HTML in comments without filename", () => {
it("Not parse HTML in multiline comments without filename", () => {
return postcss([

]).process(
Expand All @@ -139,10 +139,25 @@ describe("API", () => {

[
"css",
// PostCSS
"pcss",
"postcss",
// We Chat mini program
"wxss",
// Alipay mini program
"acss",
// SASS
"sass",
"scss",
// LESS
"less",
// SugarSS
"sss",
// Stylus
"styl",
"stylus",
].forEach(extName => {
it("Not parse HTML in comments for `*." + extName + "`", () => {
it("Not parse HTML in multiline comments for `*." + extName + "`", () => {
return postcss([

]).process(
Expand All @@ -162,11 +177,15 @@ describe("API", () => {
});

[
// SASS
"sass",
"scss",
// LESS
"less",
// SugarSS
"sss",
].forEach(extName => {
it("Not parse HTML in comments for `*." + extName + "`", () => {
it("Not parse HTML in single-line comments for `*." + extName + "`", () => {
return postcss([

]).process(
Expand Down
1 change: 1 addition & 0 deletions test/sugarss.js
Expand Up @@ -46,6 +46,7 @@ describe("SugarSS tests", () => {
syntax: syntax({
parse: sugarss.parse,
}),
from: "SugarSS.sss",
}).then(result => {
expect(result.content).to.equal(css);
});
Expand Down

0 comments on commit a5cd2d7

Please sign in to comment.