@reblu/site-blocks 0.13.0 → 0.14.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +8 -0
- package/README.md +94 -8
- package/dist/index.cjs +477 -321
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +90 -7
- package/dist/index.d.ts +90 -7
- package/dist/index.js +474 -321
- package/dist/index.js.map +1 -1
- package/dist/seo.cjs +13034 -12
- package/dist/seo.cjs.map +1 -1
- package/dist/seo.d.cts +22 -1
- package/dist/seo.d.ts +22 -1
- package/dist/seo.js +13032 -5
- package/dist/seo.js.map +1 -1
- package/package.json +3 -3
package/dist/seo.d.cts
CHANGED
|
@@ -44,4 +44,25 @@ declare function buildFaqPageJsonLd(items: readonly FaqItem[]): FaqPageJsonLd |
|
|
|
44
44
|
*/
|
|
45
45
|
declare function collectFaqItems(blocks: readonly PageBlock[] | null | undefined): FaqItem[];
|
|
46
46
|
|
|
47
|
-
|
|
47
|
+
interface MarkdownToPlainTextOptions {
|
|
48
|
+
/**
|
|
49
|
+
* Maximum length of the result, ellipsis included. Longer text is cut at the
|
|
50
|
+
* last word boundary that fits and ends in `…`. Omit for no limit.
|
|
51
|
+
*/
|
|
52
|
+
maxLength?: number;
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Markdown → the plain text a reader sees, for places that cannot render markup:
|
|
56
|
+
* a `<meta name="description">`, an Open Graph description, a card excerpt.
|
|
57
|
+
*
|
|
58
|
+
* REB-879: a course description is rich text now (headings, GFM tables, images),
|
|
59
|
+
* so slicing the raw Markdown would put `##`, table pipes and `` into a
|
|
60
|
+
* search snippet. This runs the SAME sanitised pipeline as `MarkdownRenderer`
|
|
61
|
+
* (`markdownToSafeHtml`) and keeps only its text, so it can never surface
|
|
62
|
+
* anything the renderer would have stripped (a `<script>` body, an attribute).
|
|
63
|
+
* Images contribute nothing; block elements and table cells are separated by a
|
|
64
|
+
* single space. Pure and directive-free: safe in `generateMetadata`.
|
|
65
|
+
*/
|
|
66
|
+
declare function markdownToPlainText(markdown: string | null | undefined, { maxLength }?: MarkdownToPlainTextOptions): string;
|
|
67
|
+
|
|
68
|
+
export { type FaqItem, type FaqPageJsonLd, type MarkdownToPlainTextOptions, buildFaqPageJsonLd, collectFaqItems, markdownToPlainText };
|
package/dist/seo.d.ts
CHANGED
|
@@ -44,4 +44,25 @@ declare function buildFaqPageJsonLd(items: readonly FaqItem[]): FaqPageJsonLd |
|
|
|
44
44
|
*/
|
|
45
45
|
declare function collectFaqItems(blocks: readonly PageBlock[] | null | undefined): FaqItem[];
|
|
46
46
|
|
|
47
|
-
|
|
47
|
+
interface MarkdownToPlainTextOptions {
|
|
48
|
+
/**
|
|
49
|
+
* Maximum length of the result, ellipsis included. Longer text is cut at the
|
|
50
|
+
* last word boundary that fits and ends in `…`. Omit for no limit.
|
|
51
|
+
*/
|
|
52
|
+
maxLength?: number;
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Markdown → the plain text a reader sees, for places that cannot render markup:
|
|
56
|
+
* a `<meta name="description">`, an Open Graph description, a card excerpt.
|
|
57
|
+
*
|
|
58
|
+
* REB-879: a course description is rich text now (headings, GFM tables, images),
|
|
59
|
+
* so slicing the raw Markdown would put `##`, table pipes and `` into a
|
|
60
|
+
* search snippet. This runs the SAME sanitised pipeline as `MarkdownRenderer`
|
|
61
|
+
* (`markdownToSafeHtml`) and keeps only its text, so it can never surface
|
|
62
|
+
* anything the renderer would have stripped (a `<script>` body, an attribute).
|
|
63
|
+
* Images contribute nothing; block elements and table cells are separated by a
|
|
64
|
+
* single space. Pure and directive-free: safe in `generateMetadata`.
|
|
65
|
+
*/
|
|
66
|
+
declare function markdownToPlainText(markdown: string | null | undefined, { maxLength }?: MarkdownToPlainTextOptions): string;
|
|
67
|
+
|
|
68
|
+
export { type FaqItem, type FaqPageJsonLd, type MarkdownToPlainTextOptions, buildFaqPageJsonLd, collectFaqItems, markdownToPlainText };
|