spring-io / spring-asciidoctor-backends

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

Tab support incorrectly copies callouts from other blocks #68

Closed sbrannen closed 1 year ago

sbrannen commented 1 year 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 1 year 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 1 year ago

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