File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed
asciidoc-java/src/main/java/io/yupiik/asciidoc/renderer/html Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -296,8 +296,12 @@ public void visitParagraph(final Paragraph element) {
296296
297297 @ Override
298298 public void visitHeader (final Header header ) {
299- if (header .attributes ().get ("notitle" ) == null &&
300- !header .title ().isBlank ()) {
299+ var showTitle = Boolean .parseBoolean (header .attributes ().getOrDefault ("showtitle" , "false" ))
300+ && !header .attributes ().containsKey ("notitle" );
301+ var noHeader = Boolean .parseBoolean (configuration .getAttributes ().getOrDefault ("noheader" , "false" ));
302+
303+ // showTitle has priority over noHeader (noTitle and showTitle are supposed to be mutually exclusive)
304+ if ((showTitle || !noHeader ) && !header .title ().isBlank ()) {
301305 builder .append (" <h1>" ).append (escape (header .title ())).append ("</h1>\n " );
302306 }
303307
You can’t perform that action at this time.
0 commit comments