@sarimarcus/content-sites-core 0.56.0 → 0.56.1
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 +4 -0
- package/dist/articles/render.d.ts +1 -1
- package/dist/articles/render.js +5 -3
- package/package.json +1 -1
- package/src/articles/render.ts +4 -3
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
All packages in the platform release in lockstep; entries are per release version.
|
|
4
4
|
|
|
5
|
+
## 0.56.1 (2026-11-05)
|
|
6
|
+
|
|
7
|
+
- `articles`: anchor bare `YYYY-MM-DD` dates at `T12:00:00` in `toISO`, and return inline HTML chunks from `splitParagraphs` without pre-wrapping in `<p>` so non-article callers (`guides`) and `ArticlePage` render identical paragraph markup (SLA-3723).
|
|
8
|
+
|
|
5
9
|
## 0.56.0 (2026-11-05)
|
|
6
10
|
|
|
7
11
|
- `articles`: add shared `articleSchemaFields`, `articleSuperRefineIssues`, `createArticleSchema`, `ArticleTagMeta`, and listing/pagination/tag helpers (`sortArticles`, `articlePagePath`, `articleTagPath`, `topicNeighbours`, `hubCategories`, `hubNavCategories`, `tagArticles`, `populatedTags`, `indexableTags`, `topTags`, `topCategoryTags`, `splitParagraphs`, `renderInlineMarkdown`, `toISO`, `mergeAnswerBoxFaqs`) (SLA-3715, SLA-3716, SLA-3720).
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Splits a markdown body on blank lines (`\n\n+`) and renders each chunk:
|
|
3
3
|
* block-level markdown constructs (lists, blockquotes, tables) use `parseMarkdownBlock`
|
|
4
|
-
* while ordinary prose paragraphs are
|
|
4
|
+
* while ordinary prose paragraphs are rendered inline via `parseMarkdownInline`.
|
|
5
5
|
*/
|
|
6
6
|
export declare function splitParagraphs(body: string, basePath?: string, sourcesLength?: number): string[];
|
|
7
7
|
/**
|
package/dist/articles/render.js
CHANGED
|
@@ -3,9 +3,11 @@ import { parseMarkdownBlock, parseMarkdownInline } from "../text/markdown.js";
|
|
|
3
3
|
/**
|
|
4
4
|
* Splits a markdown body on blank lines (`\n\n+`) and renders each chunk:
|
|
5
5
|
* block-level markdown constructs (lists, blockquotes, tables) use `parseMarkdownBlock`
|
|
6
|
-
* while ordinary prose paragraphs are
|
|
6
|
+
* while ordinary prose paragraphs are rendered inline via `parseMarkdownInline`.
|
|
7
7
|
*/
|
|
8
8
|
export function splitParagraphs(body, basePath = '/', sourcesLength) {
|
|
9
|
+
if (!body)
|
|
10
|
+
return [];
|
|
9
11
|
return body
|
|
10
12
|
.split(/\n\n+/)
|
|
11
13
|
.map((p) => p.trim())
|
|
@@ -14,7 +16,7 @@ export function splitParagraphs(body, basePath = '/', sourcesLength) {
|
|
|
14
16
|
if (/^(?:[-*+]|\d+\.)\s|^>\s|^\|/m.test(chunk)) {
|
|
15
17
|
return parseMarkdownBlock(chunk, basePath, sourcesLength);
|
|
16
18
|
}
|
|
17
|
-
return
|
|
19
|
+
return parseMarkdownInline(chunk, basePath, sourcesLength);
|
|
18
20
|
});
|
|
19
21
|
}
|
|
20
22
|
/**
|
|
@@ -41,7 +43,7 @@ export function toISO(dateStr, timeZone = 'Europe/Madrid') {
|
|
|
41
43
|
.formatToParts(probe)
|
|
42
44
|
.find((p) => p.type === 'timeZoneName')?.value;
|
|
43
45
|
const offset = tzPart?.replace(/^GMT/, '') || '+01:00';
|
|
44
|
-
return `${dateStr}
|
|
46
|
+
return `${dateStr}T12:00:00${offset}`;
|
|
45
47
|
}
|
|
46
48
|
/**
|
|
47
49
|
* Merges `answer-box` interludes from `sections` into the article's `faqs` list (deduping by lowercase question)
|
package/package.json
CHANGED
package/src/articles/render.ts
CHANGED
|
@@ -4,9 +4,10 @@ import { parseMarkdownBlock, parseMarkdownInline } from '../text/markdown.ts';
|
|
|
4
4
|
/**
|
|
5
5
|
* Splits a markdown body on blank lines (`\n\n+`) and renders each chunk:
|
|
6
6
|
* block-level markdown constructs (lists, blockquotes, tables) use `parseMarkdownBlock`
|
|
7
|
-
* while ordinary prose paragraphs are
|
|
7
|
+
* while ordinary prose paragraphs are rendered inline via `parseMarkdownInline`.
|
|
8
8
|
*/
|
|
9
9
|
export function splitParagraphs(body: string, basePath: string = '/', sourcesLength?: number): string[] {
|
|
10
|
+
if (!body) return [];
|
|
10
11
|
return body
|
|
11
12
|
.split(/\n\n+/)
|
|
12
13
|
.map((p) => p.trim())
|
|
@@ -15,7 +16,7 @@ export function splitParagraphs(body: string, basePath: string = '/', sourcesLen
|
|
|
15
16
|
if (/^(?:[-*+]|\d+\.)\s|^>\s|^\|/m.test(chunk)) {
|
|
16
17
|
return parseMarkdownBlock(chunk, basePath, sourcesLength);
|
|
17
18
|
}
|
|
18
|
-
return
|
|
19
|
+
return parseMarkdownInline(chunk, basePath, sourcesLength);
|
|
19
20
|
});
|
|
20
21
|
}
|
|
21
22
|
|
|
@@ -42,7 +43,7 @@ export function toISO(dateStr: string | undefined, timeZone: string = 'Europe/Ma
|
|
|
42
43
|
.formatToParts(probe)
|
|
43
44
|
.find((p) => p.type === 'timeZoneName')?.value;
|
|
44
45
|
const offset = tzPart?.replace(/^GMT/, '') || '+01:00';
|
|
45
|
-
return `${dateStr}
|
|
46
|
+
return `${dateStr}T12:00:00${offset}`;
|
|
46
47
|
}
|
|
47
48
|
|
|
48
49
|
export interface AnswerBoxSectionLike {
|