Various fixes for passthroughs and substitutions#378
Merged
Conversation
Thread `macros_enabled` from `BlockParsingMetadata` through `preprocess_inline_content` to `InlinePreprocessorParserState`. When macros are disabled, `pass:[]` macros and inline passthrough syntax (`+...+`, `++...++`, `+++...+++`) now return raw text instead of extracting passthrough content, matching asciidoctor. Closes SC-184 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
When a block has an explicit subs= list without 'attributes' (e.g.,
subs=specialchars), the inline preprocessor now leaves {attribute}
references unexpanded, matching asciidoctor behavior.
Mirrors the macros_enabled pattern from SC-184: adds attributes_enabled
flag threaded from BlockParsingMetadata through to the inline
preprocessor, gating the attribute_reference rule.
Closes SC-185
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
When subs=-macros is set, pass:[] macros are treated as literal text. However, if the macro's sub-spec includes attributes (a or n), we now expand attribute references in the content before returning the literal text, matching asciidoctor behavior. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Collapse duplicated cfg! blocks for macros/attributes into a single tuple - Extract shared pass macro parsing into parse_pass_macro_parts helper - Add new_all_enabled constructor to eliminate bare true, true args - Fix double format! allocation in triple_plus_passthrough disabled path - Fix .len() vs .chars().count() inconsistency in source map replacement Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Passthrough blocks (+++) with a subs= attribute now apply the specified substitutions to content instead of emitting it raw. Extracts raw text from RawText nodes, applies attribute substitution when enabled, then routes through quote parsing or plain text rendering based on the effective subs list. Uses empty baseline for passthrough blocks (matching asciidoctor's default of no subs for pass blocks). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Best reviewed commit by commit.