You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
15 lines
387 B
15 lines
387 B
'use strict';
|
|
|
|
/**
|
|
* Remove empty lines before a node. Mutates the node.
|
|
*
|
|
* @template {import('postcss').Rule | import('postcss').AtRule} T
|
|
* @param {T} node
|
|
* @param {string} newline
|
|
* @returns {T}
|
|
*/
|
|
module.exports = function removeEmptyLinesAfter(node, newline) {
|
|
node.raws.after = node.raws.after ? node.raws.after.replace(/(\r?\n\s*\n)+/g, newline) : '';
|
|
|
|
return node;
|
|
};
|
|
|