Skip to content

fix(markdown-toolkit): rename isMarkdown to isMDElement - #194

Merged
Jason3S merged 1 commit into
mainfrom
claude/md-ismdelement
Nov 11, 2026
Merged

Jason3S merged 1 commit into
mainfrom
claude/md-ismdelement

Conversation

@Jason3S

@Jason3S Jason3S commented Nov 10, 2026

Copy link
Copy Markdown
Contributor

Summary

The check for "is this value an element made by this library?" is now named isMDElement, after the MDElement type it narrows to. The old name, isMarkdown, still works.

  • isMDElement(value) replaces isMarkdown(value). It does the same thing.
  • isMarkdown stays exported as an alias, so existing code keeps working.
  • The old name suggested a test for Markdown text. A string of Markdown was never an element, and gives false.
Usage
import * as md from '@streetsidesoftware/markdown-toolkit';

md.isMDElement(md.p('Hi'));
// true
md.isMDElement('Hi');
// false

The guard narrows a value to `MDElement`, and it returns false for a
string of Markdown, so "isMarkdown" said the wrong thing on both counts.
The new name matches the type it narrows to.

`isMarkdown` stays exported as an alias, re-exported the way
`parseFragment` is, so existing code keeps working.
@Jason3S
Jason3S marked this pull request as ready for review November 11, 2026 05:17
@Jason3S
Jason3S merged commit 5da40a6 into main Nov 11, 2026
8 checks passed
@Jason3S
Jason3S deleted the claude/md-ismdelement branch November 11, 2026 05:18
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.

1 participant