Files
svemagie 2b2e5f33bf feat: IndieAuth PKCE sign-in + GitHub Pages relay callback
- Add IndieAuth.ts: full PKCE sign-in flow via GitHub Pages relay
- Add docs/index.html: client_id page fetched by IndieKit for app info
- Add docs/callback/index.html: relay that forwards to obsidian:// URI
- Update SettingsTab.ts: signed-in/signed-out UI, Sign In button
- Update types.ts: authorizationEndpoint, tokenEndpoint, me fields
- Update main.ts: register obsidian://micropub-auth protocol handler
2026-03-14 17:52:13 +01:00
..

@marijn/find-cluster-break

Small JavaScript module for finding grapheme cluster breaks in strings, scanning from a given position.

import {findClusterBreak} from "@marijn/find-cluster-break"
console.log(findClusterBreak("💪🏽🦋", 0))
// → 4

This code is open source, released under an MIT license.

Documentation

findClusterBreak(str: string, pos: number, forward = true, includeExtending = true): number

Returns a next grapheme cluster break after (not equal to) pos, if forward is true, or before otherwise. Returns pos itself if no further cluster break is available in the string. Moves across surrogate pairs, extending characters (when includeExtending is true, which is the default), characters joined with zero-width joiners, and flag emoji.

isExtendingChar(code: number): boolean

Query whether the given character has a Grapheme_Cluster_Break value of Extend in Unicode.