From 0be56b4b9fba4844d758667121e963af4d09bf57 Mon Sep 17 00:00:00 2001 From: Guillaume Smet Date: Tue, 28 Feb 2023 19:08:03 +0100 Subject: [PATCH 1/2] Handle strong in JavaDocParser And handle emphasis with italic, not bold as in HTML. --- .../annotation/processor/generate_doc/JavaDocParser.java | 6 ++++-- .../generate_doc/JavaDocConfigDescriptionParserTest.java | 7 ++++++- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/core/processor/src/main/java/io/quarkus/annotation/processor/generate_doc/JavaDocParser.java b/core/processor/src/main/java/io/quarkus/annotation/processor/generate_doc/JavaDocParser.java index c0afad96a5ab2..6f5d8bf6c23a8 100644 --- a/core/processor/src/main/java/io/quarkus/annotation/processor/generate_doc/JavaDocParser.java +++ b/core/processor/src/main/java/io/quarkus/annotation/processor/generate_doc/JavaDocParser.java @@ -34,16 +34,17 @@ final class JavaDocParser { private static final String NEW_LINE = "\n"; private static final String LINK_NODE = "a"; private static final String BOLD_NODE = "b"; + private static final String STRONG_NODE = "strong"; private static final String BIG_NODE = "big"; private static final String CODE_NODE = "code"; private static final String DEL_NODE = "del"; private static final String ITALICS_NODE = "i"; + private static final String EMPHASIS_NODE = "em"; private static final String TEXT_NODE = "#text"; private static final String UNDERLINE_NODE = "u"; private static final String NEW_LINE_NODE = "br"; private static final String PARAGRAPH_NODE = "p"; private static final String SMALL_NODE = "small"; - private static final String EMPHASIS_NODE = "em"; private static final String LIST_ITEM_NODE = "li"; private static final String HREF_ATTRIBUTE = "href"; private static final String STRIKE_NODE = "strike"; @@ -220,11 +221,12 @@ private void appendHtml(StringBuilder sb, Node node) { sb.append(BACKTICK); break; case BOLD_NODE: - case EMPHASIS_NODE: + case STRONG_NODE: sb.append(STAR); appendHtml(sb, childNode); sb.append(STAR); break; + case EMPHASIS_NODE: case ITALICS_NODE: sb.append(UNDERSCORE); appendHtml(sb, childNode); diff --git a/core/processor/src/test/java/io/quarkus/annotation/processor/generate_doc/JavaDocConfigDescriptionParserTest.java b/core/processor/src/test/java/io/quarkus/annotation/processor/generate_doc/JavaDocConfigDescriptionParserTest.java index b84268727d097..5410b7f7bdc91 100644 --- a/core/processor/src/test/java/io/quarkus/annotation/processor/generate_doc/JavaDocConfigDescriptionParserTest.java +++ b/core/processor/src/test/java/io/quarkus/annotation/processor/generate_doc/JavaDocConfigDescriptionParserTest.java @@ -70,9 +70,14 @@ public void parseJavaDocWithStyles() { String parsed = parser.parseConfigDescription(javaDoc); assertEquals(expectedOutput, parsed); + javaDoc = "hello world"; + expectedOutput = "hello *world*"; + parsed = parser.parseConfigDescription(javaDoc); + assertEquals(expectedOutput, parsed); + // Emphasized javaDoc = "hello world"; - expectedOutput = "*hello world*"; + expectedOutput = "_hello world_"; parsed = parser.parseConfigDescription(javaDoc); assertEquals(expectedOutput, parsed); From 93b4fd235e28403c8be1b9a2ce1872894b56759b Mon Sep 17 00:00:00 2001 From: Guillaume Smet Date: Tue, 28 Feb 2023 19:08:29 +0100 Subject: [PATCH 2/2] Fix documentation for quarkus.hibernate-orm.enabled We use the AsciiDoc format but we have HTML markups. Fixes #31418 --- .../io/quarkus/hibernate/orm/deployment/HibernateOrmConfig.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extensions/hibernate-orm/deployment/src/main/java/io/quarkus/hibernate/orm/deployment/HibernateOrmConfig.java b/extensions/hibernate-orm/deployment/src/main/java/io/quarkus/hibernate/orm/deployment/HibernateOrmConfig.java index e3c43e4e600e2..8f750396872c5 100644 --- a/extensions/hibernate-orm/deployment/src/main/java/io/quarkus/hibernate/orm/deployment/HibernateOrmConfig.java +++ b/extensions/hibernate-orm/deployment/src/main/java/io/quarkus/hibernate/orm/deployment/HibernateOrmConfig.java @@ -15,7 +15,7 @@ public class HibernateOrmConfig { /** - * Whether Hibernate ORM is enabled during the build. + * Whether Hibernate ORM is enabled *during the build*. * * If Hibernate ORM is disabled during the build, all processing related to Hibernate ORM will be skipped, * but it will not be possible to activate Hibernate ORM at runtime: