middleman / middleman-asciidoc

:beginner: AsciiDoc support for Middleman 4. (In Middleman 3, AsciiDoc support is provided by a core extension).
https://middlemanapp.com
Other
27 stars 12 forks source link

Unable to soft unset built-in attributes in Asciidoctor #93

Closed FiveYellowMice closed 3 years ago

FiveYellowMice commented 3 years ago

Reading from #72, I suppose that providing '!name' => '@' in attributes should soft unset a built-in attribute in Asciidoctor, but in fact the result is the same as a hard unset. The '-name' => '' syntax only stops this extension from passing an attribute to Asciidoctor. Using 'name' => false does a hard reset, too.

I guess the culprit is Middleman::AsciiDoc::AsciiDocExtension#merge_attributes, which seems to set the value of the hash to nil as long as the key starts or ends with a !. It also converts all falses to nils (Is there a reason to do this?).

mojavelinux commented 3 years ago

That feature was added to Asciidoctor after this extension was developed. Therefore, support for it must be added.

I'm not currently working on this project. However, I'd be willing to review and help merge a proposed change.

FiveYellowMice commented 3 years ago

Sure, I'll work on it.