Skip to content

Commit

Permalink
Improved content styles builder.
Browse files Browse the repository at this point in the history
  • Loading branch information
pomek committed Oct 2, 2024
1 parent 07e84bf commit cb062d8
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
6 changes: 5 additions & 1 deletion scripts/docs/build-content-styles.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,11 @@ export default function buildContentStyles() {
for ( const atRuleName of Object.keys( contentRules.atRules ) ) {
const rules = transformCssRules( contentRules.atRules[ atRuleName ] )
.split( '\n' )
.map( line => `\t${ line }` )
.map( line => {
const singleIndent = line.replace( /^\t{2,}/, '\t' );

return `\t${ singleIndent }`;
} )
.join( '\n' );

atRulesDefinitions.push( `@${ atRuleName } {\n${ rules }\n}` );
Expand Down
3 changes: 2 additions & 1 deletion scripts/docs/utils.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,8 @@ async function getCkeditor5ModulePaths() {
.map( packagePath => {
const shortPackageName = packagePath.replace( /^packages/, '' );

return new RegExp( shortPackageName );
// The trailing slash is needed to avoid partial matching, when an open source package name is included in a premium feature.
return new RegExp( shortPackageName + '/' );
} );

return files.filter( modulePath => {
Expand Down

0 comments on commit cb062d8

Please sign in to comment.