spring-io / spring-asciidoctor-backends

A backend for Asciidoctor used to produce Spring styled HTML
Apache License 2.0
80 stars 16 forks source link

Tab support incorrectly copies callouts from other blocks #68

Closed sbrannen closed 2 years ago

sbrannen commented 2 years ago

Overview

As mentioned in https://github.com/spring-projects/spring-framework/issues/29505 and https://github.com/spring-projects/spring-framework/commit/ac7d428a627e6dabbde500266eaeed4670e37bfb, tabs incorrectly include callouts from other blocks within a section of the generated documentation if some blocks use callouts and others do not.

Related Issues

sbrannen commented 2 years ago

As a side note, I have discovered two workarounds for this.

  1. Include callouts for every pair of primary/secondary blocks within the same section of the documentation (which is what I did in https://github.com/spring-projects/spring-framework/commit/ac7d428a627e6dabbde500266eaeed4670e37bfb).
  2. Enclose any pair of primary/secondary blocks that do not use callouts in a double-underscore block, like below.
--
[source,java,indent=0,subs="verbatim,quotes",role="primary"]
.Java
----
    @PutMapping("/accounts/{account}")
    public String save(@ModelAttribute("account") Account account) {
        // ...
    }
----

[source,kotlin,indent=0,subs="verbatim,quotes",role="secondary"]
.Kotlin
----
    @PutMapping("/accounts/{account}")
    fun save(@ModelAttribute("account") account: Account): String {
        // ...
    }
----
--
sbrannen commented 2 years ago

That was a very quick turnaround. Thanks, @wilkinsona! 👍