@dosgato/templating 0.0.104 → 0.0.106
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/dist/links.d.ts +1 -1
- package/dist/links.js +1 -2
- package/dist/render.d.ts +5 -1
- package/package.json +1 -1
package/dist/links.d.ts
CHANGED
|
@@ -85,4 +85,4 @@ export declare function extractLinksFromText(text: string | undefined): LinkDefi
|
|
|
85
85
|
* This function is used by render definitions to replace links in large blocks with the actual
|
|
86
86
|
* URLs they point to at render time.
|
|
87
87
|
*/
|
|
88
|
-
export declare function replaceLinksInText(text: string, resolved: Map<string, string>): string;
|
|
88
|
+
export declare function replaceLinksInText(text: string, resolved: Map<string, string | undefined>): string;
|
package/dist/links.js
CHANGED
|
@@ -14,6 +14,5 @@ export function extractLinksFromText(text) {
|
|
|
14
14
|
* URLs they point to at render time.
|
|
15
15
|
*/
|
|
16
16
|
export function replaceLinksInText(text, resolved) {
|
|
17
|
-
|
|
18
|
-
return text.replace(LinkRegex, m => resolved.get(m) ?? '#');
|
|
17
|
+
return text.replace(LinkRegex, m => resolved.get(m) ?? 'dg-broken-link');
|
|
19
18
|
}
|
package/dist/render.d.ts
CHANGED
|
@@ -81,11 +81,15 @@ export interface APIClient {
|
|
|
81
81
|
* By default this will generate relative links based on the page currently being rendered. Set
|
|
82
82
|
* absolute: true to generate a full URL suitable for a backend http request or non-HTML document
|
|
83
83
|
* like an RSS feed.
|
|
84
|
+
*
|
|
85
|
+
* Will be undefined for cross-site links to pages without launch info, since the resulting link would be
|
|
86
|
+
* broken, but if a site has launch info that is simply disabled, getHref will still work. Any links generated
|
|
87
|
+
* would work as soon as the launch info is enabled.
|
|
84
88
|
*/
|
|
85
89
|
getHref: (page: PageRecordOptionalData, opts?: {
|
|
86
90
|
absolute?: boolean;
|
|
87
91
|
extension?: string;
|
|
88
|
-
}) => string;
|
|
92
|
+
}) => string | undefined;
|
|
89
93
|
/**
|
|
90
94
|
* This function will retrieve information about an image to help you construct responsive HTML
|
|
91
95
|
* for a <picture> element including the <img> and all <source> tags.
|