-
-
Notifications
You must be signed in to change notification settings - Fork 78
Issue 158 nested attributes 3 #265
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
…es not supplied to docs
…es supplied to docs as strings
Asciidoctor now allows the override modifier to be set on the key instead of the value (for this very reason). It may still be necessary to mix in a module the value to respond to any methods that the core processor tries to call on it. But I believe it is possible to preserve the value and communicate that it can be overridden. |
I can't speak to the motivation behind the code that allows '@' on keys as well as values, but the effect is to convert the value to a string and append '@':
(line 303, document.rb) IMO if there was a real intent to allow object attribute values, the '@' handling in Asciidoctor would have been rewritten so that the overridability of an attribute_overrides entry would be in a flag rather than encoded in the attribute value. I actually think that both this and coercing all supplied attributes to string upfront make the most sense. I don't think the current behavior of allowing objects as attribute values and then converting them to strings if they happen to be overridable makes any sense. I think that either:
Unfortunately these are both breaking changes. |
I agree that we should not be trying to convince core to allow object values as values are, by definition, strings. I realize this is a tough situation. I just wanted to emphasize that we did at the |
I certainly agree that |
This implementation has only the attribute names in
merge_attributes
and supplies a stringified version of the_config.yml
attribute value to the pages. This is the only way I see to tell Asciidoctor that the value can be overridden. This behavior is inconsistent with other object valued attributes, which can be accessed as objects by extensions. However, if the value is overridden for merging by a page header attribute, the value would be a string. Perhaps stringifying the object into yaml would be more useful than using Ruby's.to_s
operator.