diff --git a/service/src/main/java/skills/services/CustomValidator.groovy b/service/src/main/java/skills/services/CustomValidator.groovy index 3615e92a83..3e19b31011 100644 --- a/service/src/main/java/skills/services/CustomValidator.groovy +++ b/service/src/main/java/skills/services/CustomValidator.groovy @@ -79,7 +79,7 @@ class CustomValidator { private static final Pattern HTML = ~/(?s)<[\/]?\w+(?: .+?)*>/ private static final Pattern CODEBLOCK = ~/(?ms)(^[`]{3}$.*?^[`]{3}$)/ - private static final Pattern TABLE_FIX = ~/(?m)(^\n)(^[|].+[|]$\n^[|].*[-]{3,}.*[|]$)/ + private static final Pattern TABLE_FIX = ~/(?ms)(^\n)(^[|].+[|]$\n^[|].*[-]{3,}.*[|]$)/ private static final Pattern CODEBLOCK_FIX = ~/(?m)(^\n)(^[`]{3}$)/ private static final Pattern LIST_FIX = ~/(?m)(^\n)(\s*\d\. |\* |- .*$)/ diff --git a/service/src/test/java/skills/services/CustomValidatorSpec.groovy b/service/src/test/java/skills/services/CustomValidatorSpec.groovy index b3a74f9472..8f976471d9 100644 --- a/service/src/test/java/skills/services/CustomValidatorSpec.groovy +++ b/service/src/test/java/skills/services/CustomValidatorSpec.groovy @@ -679,6 +679,36 @@ if (a == true) { validator.init() then: + + validator.validateDescription("""(A) + +| **Column1  | Column2  | Column3  | Column4  | Column5  | Column6  | Column7  | Column8  | Column9  | +| -------- | -------- | -------- | -------- | -------- | -------- | -------- | -------- | -------- | +| eafe  |   |   |   |   |   |   |   |   | +|   | eafe  |   |   |   |   |   |   |   | +|   |   |   | eafe  |   |   |   |   |   | +|   |   |   | eafe  |   |   |   |   |   | +|   |   |   |   |   | eafe  |   |   |   | +|   |   |   |   |   |   |   |   |   | +|   |   |   |   |   |   |   |   | eafe  | +""").valid + + validator.validateDescription("""(A) some words + +| **Heading 1** | **Heading 2** | **Heading 1** | +| ----- | ---------- | ---- | +| Row 1: Value 1 | Row 1: Value 2 | Row 1: Value 3 | +| Row 1: Value 1 | Row 1: Value 2 | Row 1: Value 3 |""").valid + validator.validateDescription("""(A) this is some normal text (A) cool, not cools""").valid