diff --git a/spring-boot-project/spring-boot-tools/spring-boot-configuration-docs/src/main/java/org/springframework/boot/configurationdocs/CompoundConfigurationTableEntry.java b/spring-boot-project/spring-boot-tools/spring-boot-configuration-docs/src/main/java/org/springframework/boot/configurationdocs/CompoundConfigurationTableEntry.java index 603e902f5d..b8c81819f7 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-configuration-docs/src/main/java/org/springframework/boot/configurationdocs/CompoundConfigurationTableEntry.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-configuration-docs/src/main/java/org/springframework/boot/configurationdocs/CompoundConfigurationTableEntry.java @@ -45,9 +45,9 @@ class CompoundConfigurationTableEntry extends ConfigurationTableEntry { @Override void write(AsciidocBuilder builder) { - builder.append("|"); + builder.append("¦"); this.configurationKeys.forEach(builder::appendKey); - builder.newLine().appendln("|").appendln("|+++", this.description, "+++"); + builder.newLine().appendln("¦").appendln("¦+++", this.description, "+++"); } } diff --git a/spring-boot-project/spring-boot-tools/spring-boot-configuration-docs/src/main/java/org/springframework/boot/configurationdocs/ConfigurationTable.java b/spring-boot-project/spring-boot-tools/spring-boot-configuration-docs/src/main/java/org/springframework/boot/configurationdocs/ConfigurationTable.java index 83a36d9bb1..f7bc2edb18 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-configuration-docs/src/main/java/org/springframework/boot/configurationdocs/ConfigurationTable.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-configuration-docs/src/main/java/org/springframework/boot/configurationdocs/ConfigurationTable.java @@ -46,9 +46,9 @@ class ConfigurationTable { String toAsciidocTable() { AsciidocBuilder builder = new AsciidocBuilder(); - builder.appendln("[cols=\"1,1,2\", options=\"header\"]"); + builder.appendln("[cols=\"1,1,2\", separator=¦, options=\"header\"]"); builder.appendln("|==="); - builder.appendln("|Key|Default Value|Description"); + builder.appendln("¦Key¦Default Value¦Description"); builder.appendln(); this.entries.forEach((entry) -> { entry.write(builder); diff --git a/spring-boot-project/spring-boot-tools/spring-boot-configuration-docs/src/main/java/org/springframework/boot/configurationdocs/SingleConfigurationTableEntry.java b/spring-boot-project/spring-boot-tools/spring-boot-configuration-docs/src/main/java/org/springframework/boot/configurationdocs/SingleConfigurationTableEntry.java index f1832a6944..bc5e62b572 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-configuration-docs/src/main/java/org/springframework/boot/configurationdocs/SingleConfigurationTableEntry.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-configuration-docs/src/main/java/org/springframework/boot/configurationdocs/SingleConfigurationTableEntry.java @@ -54,7 +54,7 @@ class SingleConfigurationTableEntry extends ConfigurationTableEntry { @Override void write(AsciidocBuilder builder) { - builder.appendln("|`+", this.key, "+`"); + builder.appendln("¦`+", this.key, "+`"); writeDefaultValue(builder); writeDescription(builder); builder.appendln(); @@ -62,22 +62,21 @@ class SingleConfigurationTableEntry extends ConfigurationTableEntry { private void writeDefaultValue(AsciidocBuilder builder) { String defaultValue = (this.defaultValue != null) ? this.defaultValue : ""; - defaultValue = defaultValue.replace("\\", "\\\\").replace("|", "{vbar}" + System.lineSeparator()); + defaultValue = defaultValue.replace("\\", "\\\\"); if (defaultValue.isEmpty()) { - builder.appendln("|"); + builder.appendln("¦"); } else { - builder.appendln("|`+", defaultValue, "+`"); + builder.appendln("¦`+", defaultValue, "+`"); } } private void writeDescription(AsciidocBuilder builder) { if (this.description == null || this.description.isEmpty()) { - builder.append("|"); + builder.append("¦"); } else { - String cleanedDescription = this.description.replace("|", "\\|"); - builder.append("|+++", cleanedDescription, "+++"); + builder.append("¦+++", this.description, "+++"); } } diff --git a/spring-boot-project/spring-boot-tools/spring-boot-configuration-docs/src/test/java/org/springframework/boot/configurationdocs/CompoundConfigurationTableEntryTests.java b/spring-boot-project/spring-boot-tools/spring-boot-configuration-docs/src/test/java/org/springframework/boot/configurationdocs/CompoundConfigurationTableEntryTests.java index 0e06b59509..85a9c7c6e9 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-configuration-docs/src/test/java/org/springframework/boot/configurationdocs/CompoundConfigurationTableEntryTests.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-configuration-docs/src/test/java/org/springframework/boot/configurationdocs/CompoundConfigurationTableEntryTests.java @@ -48,8 +48,8 @@ class CompoundConfigurationTableEntryTests { AsciidocBuilder builder = new AsciidocBuilder(); entry.write(builder); assertThat(builder.toString()).isEqualTo( - "|`+spring.test.first+` +" + NEWLINE + "`+spring.test.second+` +" + NEWLINE + "`+spring.test.third+` +" - + NEWLINE + NEWLINE + "|" + NEWLINE + "|+++This is a description.+++" + NEWLINE); + "¦`+spring.test.first+` +" + NEWLINE + "`+spring.test.second+` +" + NEWLINE + "`+spring.test.third+` +" + + NEWLINE + NEWLINE + "¦" + NEWLINE + "¦+++This is a description.+++" + NEWLINE); } } diff --git a/spring-boot-project/spring-boot-tools/spring-boot-configuration-docs/src/test/java/org/springframework/boot/configurationdocs/ConfigurationTableTests.java b/spring-boot-project/spring-boot-tools/spring-boot-configuration-docs/src/test/java/org/springframework/boot/configurationdocs/ConfigurationTableTests.java index 2b15a47675..55b1d17881 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-configuration-docs/src/test/java/org/springframework/boot/configurationdocs/ConfigurationTableTests.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-configuration-docs/src/test/java/org/springframework/boot/configurationdocs/ConfigurationTableTests.java @@ -46,10 +46,10 @@ class ConfigurationTableTests { second.setType("java.lang.String"); table.addEntry(new SingleConfigurationTableEntry(first)); table.addEntry(new SingleConfigurationTableEntry(second)); - assertThat(table.toAsciidocTable()).isEqualTo("[cols=\"1,1,2\", options=\"header\"]" + NEWLINE + "|===" - + NEWLINE + "|Key|Default Value|Description" + NEWLINE + NEWLINE + "|`+spring.test.other+`" + NEWLINE - + "|`+other value+`" + NEWLINE + "|+++This is another description.+++" + NEWLINE + NEWLINE - + "|`+spring.test.prop+`" + NEWLINE + "|`+something+`" + NEWLINE + "|+++This is a description.+++" + assertThat(table.toAsciidocTable()).isEqualTo("[cols=\"1,1,2\", separator=¦, options=\"header\"]" + NEWLINE + + "|===" + NEWLINE + "¦Key¦Default Value¦Description" + NEWLINE + NEWLINE + "¦`+spring.test.other+`" + + NEWLINE + "¦`+other value+`" + NEWLINE + "¦+++This is another description.+++" + NEWLINE + NEWLINE + + "¦`+spring.test.prop+`" + NEWLINE + "¦`+something+`" + NEWLINE + "¦+++This is a description.+++" + NEWLINE + NEWLINE + "|===" + NEWLINE); } diff --git a/spring-boot-project/spring-boot-tools/spring-boot-configuration-docs/src/test/java/org/springframework/boot/configurationdocs/SingleConfigurationTableEntryTests.java b/spring-boot-project/spring-boot-tools/spring-boot-configuration-docs/src/test/java/org/springframework/boot/configurationdocs/SingleConfigurationTableEntryTests.java index 8da4cc76c7..642844cb6b 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-configuration-docs/src/test/java/org/springframework/boot/configurationdocs/SingleConfigurationTableEntryTests.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-configuration-docs/src/test/java/org/springframework/boot/configurationdocs/SingleConfigurationTableEntryTests.java @@ -41,8 +41,8 @@ class SingleConfigurationTableEntryTests { SingleConfigurationTableEntry entry = new SingleConfigurationTableEntry(property); AsciidocBuilder builder = new AsciidocBuilder(); entry.write(builder); - assertThat(builder.toString()).isEqualTo("|`+spring.test.prop+`" + NEWLINE + "|`+something+`" + NEWLINE - + "|+++This is a description.+++" + NEWLINE); + assertThat(builder.toString()).isEqualTo("¦`+spring.test.prop+`" + NEWLINE + "¦`+something+`" + NEWLINE + + "¦+++This is a description.+++" + NEWLINE); } @Test @@ -55,7 +55,7 @@ class SingleConfigurationTableEntryTests { AsciidocBuilder builder = new AsciidocBuilder(); entry.write(builder); assertThat(builder.toString()).isEqualTo( - "|`+spring.test.prop+`" + NEWLINE + "|" + NEWLINE + "|+++This is a description.+++" + NEWLINE); + "¦`+spring.test.prop+`" + NEWLINE + "¦" + NEWLINE + "¦+++This is a description.+++" + NEWLINE); } @Test @@ -68,8 +68,8 @@ class SingleConfigurationTableEntryTests { SingleConfigurationTableEntry entry = new SingleConfigurationTableEntry(property); AsciidocBuilder builder = new AsciidocBuilder(); entry.write(builder); - assertThat(builder.toString()).isEqualTo("|`+spring.test.prop+`" + NEWLINE + "|`+first{vbar}" + NEWLINE - + "second+`" + NEWLINE + "|+++This is a description.+++" + NEWLINE); + assertThat(builder.toString()).isEqualTo("¦`+spring.test.prop+`" + NEWLINE + "¦`+first|second+`" + NEWLINE + + "¦+++This is a description.+++" + NEWLINE); } @Test @@ -82,8 +82,8 @@ class SingleConfigurationTableEntryTests { SingleConfigurationTableEntry entry = new SingleConfigurationTableEntry(property); AsciidocBuilder builder = new AsciidocBuilder(); entry.write(builder); - assertThat(builder.toString()).isEqualTo("|`+spring.test.prop+`" + NEWLINE + "|`+first\\\\second+`" + NEWLINE - + "|+++This is a description.+++" + NEWLINE); + assertThat(builder.toString()).isEqualTo("¦`+spring.test.prop+`" + NEWLINE + "¦`+first\\\\second+`" + NEWLINE + + "¦+++This is a description.+++" + NEWLINE); } @Test @@ -95,8 +95,8 @@ class SingleConfigurationTableEntryTests { SingleConfigurationTableEntry entry = new SingleConfigurationTableEntry(property); AsciidocBuilder builder = new AsciidocBuilder(); entry.write(builder); - assertThat(builder.toString()).isEqualTo("|`+spring.test.prop+`" + NEWLINE + "|" + NEWLINE - + "|+++This is a description with a \\| pipe.+++" + NEWLINE); + assertThat(builder.toString()).isEqualTo("¦`+spring.test.prop+`" + NEWLINE + "¦" + NEWLINE + + "¦+++This is a description with a | pipe.+++" + NEWLINE); } @Test @@ -109,7 +109,7 @@ class SingleConfigurationTableEntryTests { AsciidocBuilder builder = new AsciidocBuilder(); entry.write(builder); assertThat(builder.toString()).isEqualTo( - "|`+spring.test.prop.*+`" + NEWLINE + "|" + NEWLINE + "|+++This is a description.+++" + NEWLINE); + "¦`+spring.test.prop.*+`" + NEWLINE + "¦" + NEWLINE + "¦+++This is a description.+++" + NEWLINE); } @Test @@ -123,8 +123,8 @@ class SingleConfigurationTableEntryTests { SingleConfigurationTableEntry entry = new SingleConfigurationTableEntry(property); AsciidocBuilder builder = new AsciidocBuilder(); entry.write(builder); - assertThat(builder.toString()).isEqualTo("|`+spring.test.prop+`" + NEWLINE + "|`+first," + NEWLINE + "second," - + NEWLINE + "third+`" + NEWLINE + "|+++This is a description.+++" + NEWLINE); + assertThat(builder.toString()).isEqualTo("¦`+spring.test.prop+`" + NEWLINE + "¦`+first," + NEWLINE + "second," + + NEWLINE + "third+`" + NEWLINE + "¦+++This is a description.+++" + NEWLINE); } }