Skip to content

Fix closeable directive for plain text content - #2918

Merged
Incogdino merged 1 commit into
MarkBind:masterfrom
nightcityblade:fix/issue-2662
Aug 9, 2026
Merged

Fix closeable directive for plain text content#2918
Incogdino merged 1 commit into
MarkBind:masterfrom
nightcityblade:fix/issue-2662

Conversation

@nightcityblade

@nightcityblade nightcityblade commented Aug 8, 2026

Copy link
Copy Markdown
Contributor

What is the purpose of this pull request?

  • Documentation update
  • Bug fix
  • Feature addition or enhancement
  • Code maintenance
  • DevOps
  • Improve developer experience
  • Others, please explain:

Fixes #2662.

Overview of changes:

  • Move all child nodes, including text nodes, into the closeable content wrapper.
  • Add a regression test for plain-text closeable content.

Anything you'd like to highlight/discuss:

The directive previously iterated over Element.children, which excludes text nodes. It now uses childNodes so plain text is preserved alongside element children.

Testing instructions:

N/A.

Proposed commit message: (wrap lines at 72 characters)

Fix closeable plain text handling


Checklist: ☑️

  • Updated the documentation for feature additions and enhancements
  • Added tests for bug fixes or features
  • Linked all related issues
  • No unrelated changes

Reviewer checklist:

Indicate the SEMVER impact of the PR:

  • Major (when you make incompatible API changes)
  • Minor (when you add functionality in a backward compatible manner)
  • Patch (when you make backward compatible bug fixes)

At the end of the review, please label the PR with the appropriate label: r.Major, r.Minor, r.Patch.

Breaking change release note preparation (if applicable):

  • To be included in the release note for any feature that is made obsolete/breaking

Give a brief explanation note about:

  • what was the old feature that was made obsolete
  • any replacement feature (if any), and
  • how the author should modify his website to migrate from the old feature to the replacement feature (if possible).

@codecov

codecov Bot commented Aug 8, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 71.32%. Comparing base (f1943ee) to head (31139ec).

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #2918   +/-   ##
=======================================
  Coverage   71.32%   71.32%           
=======================================
  Files         133      133           
  Lines        7234     7234           
  Branches     1642     1650    +8     
=======================================
  Hits         5160     5160           
  Misses       1973     1973           
  Partials      101      101           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@Incogdino Incogdino left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Hi, thank you for the pr! The update works well visually.

Please help to update the snapshot tests by running the updatetest script using npm run updatetest

You can refer to the dev docs here: https://markbind.org/devdocs/devGuide/development/workflow.html#updating-functional-tests

@nightcityblade

Copy link
Copy Markdown
Contributor Author

Thanks for the review. I ran the requested snapshot update from this branch after npm ci and npm run build:backend (the build is needed to generate the CLI functional-test runner):

npm run updatetest

It completed successfully for both markbind-cli and @markbind/vue-components, with all 105 existing Vue snapshots passing, but it produced no tracked snapshot changes (git status remained clean). I also reran the focused test:

npm test --workspace @markbind/vue-components -- Closeable.spec.js --runInBand

That passed as well. If you expected a specific functional snapshot to change, could you point me to that case? I do not want to commit generated files that are identical to the current snapshots.

@Incogdino Incogdino left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

@Incogdino
Incogdino merged commit 0dabc47 into MarkBind:master Aug 9, 2026
11 checks passed
@github-actions github-actions Bot added the r.Patch Version resolver: increment by 0.0.1 label Aug 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

r.Patch Version resolver: increment by 0.0.1

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Closeable Directive does not work for html plain text

2 participants