Fix compose config test service parsing

This commit is contained in:
Jeppe Bundgaard
2026-04-24 19:13:41 +02:00
parent ca64f2b047
commit cef53d8ebd
+1 -1
View File
@@ -24,7 +24,7 @@ const traefikSource = [
function readComposeServiceBlock(composeSource, serviceName) {
const escapedServiceName = serviceName.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
const servicePattern = new RegExp(
`^\\s{2}${escapedServiceName}:\\n([\\s\\S]*?)(?=^\\s{2}[A-Za-z0-9_-]+:|^volumes:|^networks:|\\Z)`,
`^[ ]{2}${escapedServiceName}:\\r?\\n([\\s\\S]*?)(?=^[ ]{2}[A-Za-z0-9_-]+:|^volumes:|^networks:|(?![\\s\\S]))`,
"m"
);
const match = composeSource.match(servicePattern);