spring-io / spring-asciidoctor-extensions

Asciidoctor Extensions developed by the Spring team
46 stars 18 forks source link

configprop macro does not always honour its format attribute #51

Closed wilkinsona closed 4 years ago

wilkinsona commented 4 years ago

The default should be :attributes which results in the value being parsed into the attributes map. Sometimes, however, it ends up being treated as text which results in the attributes map containing text=<value>. For example, configprop:spring.config.name[format=envvar] should result in an attributes map containing a single format -> envvar key-value pair. When the value is treated as text, the attributes map ends up containing a single text -> format=envar key-value pair. Hopefully, explicitly configuring the use of :attributes will fix the problem.

wilkinsona commented 4 years ago

The problem's due to a bug in AsciidoctorJ. We can work around it by normalising the attributes into their parsed form when the macro is passed a single text attribute.