You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(parser): add support for internal ## File: header
This commit introduces support for a new internal header format within code blocks: `## File: path/to/file.ext`.
Similar to the existing `// File:` format, this header can appear on the first line of a fenced code block to specify the file path for the block's content. The header line itself is excluded from the generated file content.
This format provides an alternative way to define file paths internally, especially useful in contexts where `//` comments might not be standard (e.g., YAML, plain text).
Key features:
- Recognizes `## File: path` and `## File: \`path with spaces\``.
- Extracts the path, handling optional backticks.
- Excludes the header line from the output file content.
- Applies path format validation (rejects empty or invalid paths like `//`).
- Ignores the header if it doesn't appear on the *first* line of the block.
Added corresponding integration tests in `tests/parser/create_internal.rs` to verify the new format and its edge cases.
0 commit comments