src/lib/form/extractors/strategies/title.ts
Symbols by Kind
method
1
All Symbols
| Name | Kind | Visibility | Status | Lines | Signature |
|---|---|---|---|---|---|
| find | method | - | 11-15 | find(element: HTMLElement): : LabelResult | null |
Full Source
/**
* Label Strategy — title
*
* Reads the HTML `title` attribute.
*/
import type { LabelResult, LabelStrategy } from "../label-strategy.interface";
export const titleStrategy: LabelStrategy = {
name: "title",
find(element: HTMLElement): LabelResult | null {
const title = element.getAttribute("title");
const text = title?.trim();
return text ? { text, strategy: "title" } : null;
},
};