feat: Fragment identifier full line ignore#2626
feat: Fragment identifier full line ignore#2626sy-records merged 12 commits intodocsifyjs:developfrom
Conversation
|
@jacobsorme is attempting to deploy a commit to the Docsify Team on Vercel. A member of the Team first needs to authorize it. |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
Pull Request Overview
This PR adds a new :fragmentFullLine option that enables full-line exclusion of fragment identifier lines when embedding file fragments. When enabled, the entire line containing the fragment marker (e.g., /// [demo] comment text) is excluded from the embedded content, not just the marker itself.
Key Changes:
- Added
fragmentFullLineparameter toextractFragmentContentfunction and updated regex logic to support full-line matching - Updated compiler to pass through
fragmentFullLineconfiguration - Fixed grammar in media error messages ("Not Support" → "Not Supported")
Reviewed Changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| test/integration/example.test.js | Added integration test verifying full-line fragment exclusion behavior |
| src/core/render/embed.js | Modified extractFragmentContent to accept and handle fullLine parameter with updated regex logic |
| src/core/render/compiler.js | Added fragmentFullLine property assignment to embed configuration |
| src/core/render/compiler/media.js | Fixed grammar in video and audio error messages |
| docs/embed-files.md | Documented the new :fragmentFullLine option |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Koooooo-7
left a comment
There was a problem hiding this comment.
LGTM.
A tiny suggest is we may name the config as omitFragmentLine (as well as within the codebase) which seems more understandable for the purpose.
Co-authored-by: Koy Zhuang <koyzhuang@qq.com>
|
Can you all please add an example to the docs? It isn't clear from the update doc what exactly this does. The explanation is too simple. |
|
Sure thing, will look into example + better formulated explanation. This is the look ATM
The use case for me is specifically this - I want to both use a HTML file for a Docsify snippet, and be able to render the file stand-alone. Neither
How about something like that + a short HTML example & Docsify markdown embed line? |
Summary
New option
:fragmentFullLine:omitFragmentLinethat when used will enable full-line ignore of file embed fragment lines.Related issue, if any:
What kind of change does this PR introduce?
For any code change,
Does this PR introduce a breaking change?
Tested in the following browsers: