metanorma / coradoc

Coradoc is the Core AsciiDoc Parser used by Metanorma
MIT License
1 stars 4 forks source link

audio, video blocks: use AttributeList for empty attributes? #48

Closed ronaldtse closed 6 months ago

ronaldtse commented 7 months ago

In audio.rb and video.rb, there is this line:

attrs = @attributes.empty? ? "\[\]" : @attributes.to_adoc

Since we have AttributeList, you can implement AttributeList.to_adoc which returns [] when empty. So this line can go away, and the next line uses attrs.to_adoc instead of attrs.

_Originally posted by @ronaldtse in https://github.com/metanorma/coradoc/pull/47#discussion_r1580073783_