// Copyright (c) 2026 Modelware. All rights reserved.
export class MarkdownHandlerRegistry {
    constructor() {
        this.handlers = [];
    }
    register(handler) {
        if (this.handlers.some((h) => h.id === handler.id)) {
            throw new Error(`Duplicate markdown handler id: ${handler.id}`);
        }
        this.handlers.push(handler);
    }
    match(block) {
        return this.handlers.find((handler) => handler.supports(block));
    }
    list() {
        return this.handlers;
    }
}
//# sourceMappingURL=md-registry.js.map