FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

feat: Fragment identifier full line ignore by jacobsorm · Pull Request #2626 · docsifyjs/docsify · GitHub

Repository navigation

feat: Fragment identifier full line ignore - #2626

Merged
sy-records merged 12 commits into
docsifyjs:developfrom
jacobsorm:develop4
Nov 24, 2025
Merged

sy-records merged 12 commits into
docsifyjs:developfrom
jacobsorm:develop4

Conversation

jacobsorm commented Nov 10, 2025 •
edited by trusktr
Loading

Copy link
Copy Markdown
Contributor

Summary

New option :fragmentFullLine :omitFragmentLine that when used will enable full-line ignore of file embed fragment lines.

Related issue, if any:

What kind of change does this PR introduce?

  • Bugfix
  • Feature
  • Code style update (formatting, renaming)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • Documentation content changes
  • Other (please describe):

For any code change,

  • Related documentation has been updated, if needed
  • Related tests have been added or updated, if needed

Does this PR introduce a breaking change?

  • Yes
  • No

Tested in the following browsers:

  • Chrome
  • Firefox
  • Safari
  • Edge

vercel Bot commented Nov 10, 2025

Copy link
Copy Markdown

@jacobsorme is attempting to deploy a commit to the Docsify Team on Vercel.

A member of the Team first needs to authorize it.

vercel Bot commented Nov 11, 2025 •
edited
Loading

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
docsify-preview Ready Preview Comment Nov 24, 2025 2:22am

sy-records changed the title Fragment identifier full line ignore feat: Fragment identifier full line ignore Nov 11, 2025

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

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 fragmentFullLine parameter to extractFragmentContent function and updated regex logic to support full-line matching
  • Updated compiler to pass through fragmentFullLine configuration
  • 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.

Comment thread src/core/render/embed.js Outdated
Comment thread src/core/render/embed.js Outdated
Comment thread src/core/render/embed.js Outdated
jacobsorm and others added 4 commits November 11, 2025 10:53
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

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

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.

Comment thread docs/embed-files.md Outdated

Koooooo-7 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

LGTM, thx!

sy-records merged commit e811756 into docsifyjs:develop Nov 24, 2025
6 of 7 checks passed

trusktr commented Dec 4, 2025

Copy link
Copy Markdown
Member

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.

jacobsorm commented Dec 4, 2025 •
edited
Loading

Copy link
Copy Markdown
Contributor Author

Sure thing, will look into example + better formulated explanation.

This is the look ATM

In your code file you need to surround the fragment between /// [demo] lines (before and after the fragment). Alternatively you can use ### [demo]. By default, only identifiers are omitted. To omit the entire line containing the identifier in the fragment output, you can add the :omitFragmentLine option.

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<!-- /// [demo] --> nor /// [demo] solves both these cases, the first gives me a --> in Docsify and the latter a /// [demo] in the stand-alone page.

In your code file you need to surround the fragment between /// [demo] lines (before and after the fragment). Alternatively you can use ### [demo]. By default, only identifiers are omitted. To omit the entire line containing the identifier in the fragment output, you can add the :omitFragmentLine option. This is useful if your code fragment is e.g. HTML and you want to hide the Docsify fragment identifier from your HTML output. With :omitFragmentLine the trailing --> of the comment <!-- /// [demo] --> won't be included in the Docsify fragment.

How about something like that + a short HTML example & Docsify markdown embed line?

jacobsorm mentioned this pull request Dec 16, 2025
2 of 15 tasks
sy-records mentioned this pull request Jul 17, 2026
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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants


Back | FazBrowse Home | New Git URL