Repository navigation
feat(kiritan): keep leading YAML front matter verbatim - #49
Merged
Merged
Conversation
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
7 of 10 tasks
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
Preserve leading front matter in the missing-sidecar path and add an integration regression test.
Get a fresh assessment by requesting another Copilot review.
Review effort: Lite
Findings: 1
What changed in this PR
Adds opaque YAML front-matter preservation for Markdown parsing, stringifying, and interpolation.
Changes:
- Adds
remark-frontmattersupport and regression tests. - Updates dependencies and design documentation.
- Drops the proposed
translateFrontmatteroption.
| File | Summary |
|---|---|
packages/kiritan/src/interpolate/index.test.ts |
Tests interpolation exclusion for front matter. |
packages/kiritan/src/directive/parse.ts |
Adds front-matter handling; missing-sidecar ordering still requires correction. |
packages/kiritan/src/directive/parse.test.ts |
Tests YAML parsing and round-tripping. |
packages/kiritan/package.json |
Adds the front-matter dependency. |
package-lock.json |
Locks dependency updates. |
docs/DESIGN.md |
Updates English design documentation. |
docs/DESIGN.ja.md |
Updates Japanese design documentation. |
base/DESIGN.base.md |
Updates roadmap source documentation. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Comment on lines
+9
to
+11
| const parser = unified() | ||
| .use(remarkParse) | ||
| .use(remarkFrontmatter) |
Owner
Author
There was a problem hiding this comment.
Fixed in #55: the fallback marker now goes after leading front matter, with an integration test through build.
Merged
7 of 10 tasks
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.

Summary
A leading
---YAML block is now kept as one opaque node (viaremark-frontmatter), so it survives parse/stringify verbatim and interpolation never touches it. Before, it was parsed as a thematic break plus a setext heading and got mangled on output.The
translateFrontmatteroption from the design doc is dropped:inline/cataloghave no place for a per-locale value, and asidecartranslation already owns its own front matter. DESIGN.md chapter 6 and the roadmap are updated to match.Why?
This is the first step of the
text/mdxrenderer roadmap item, and it is useful on its own for any Markdown source that carries front matter.Related issue(s)
closes
Check
CONTRIBUTING.md(rules)npm run check(lint & format)npm run typechecknpm run test(functions test)npm run build(dist/)npm run test:coverageand check nothing new went uncovered