@happeouikit/content-renderer 3.3.1 → 3.4.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/dist/index.cjs.js +91 -91
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.es.js +974 -939
- package/dist/index.es.js.map +1 -1
- package/dist/links.d.ts +19 -0
- package/dist/utils.d.ts +2 -1
- package/package.json +2 -2
package/dist/links.d.ts
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Support unique ids for headers for new content
|
|
3
|
+
*
|
|
4
|
+
* ID's are of format xhhhhhhh (x followed by 7 hexadecimal numbers)
|
|
5
|
+
* New content should be automatically created with this type of id, but old content probably do not have any ids at all.
|
|
6
|
+
*
|
|
7
|
+
* If the element has this type of id then we generate links with hash such as #snippet+id
|
|
8
|
+
* The snippet will be ignored by the system and it will actually be updated if the content of the header changes.
|
|
9
|
+
*
|
|
10
|
+
* If the element does not have an id at all (all/most legacy content), then we generate one based on the content of the header.
|
|
11
|
+
* This approach does not support duplicates or updates to the header content
|
|
12
|
+
*
|
|
13
|
+
*/
|
|
14
|
+
export declare const linkRandomIdRegex: RegExp;
|
|
15
|
+
export declare const linkSnippetWithIdRegex: RegExp;
|
|
16
|
+
export declare const getRandomLinkId: () => string;
|
|
17
|
+
export declare const getLinkIdFromFragment: (fragment: string) => string;
|
|
18
|
+
export declare const getLinkSnippet: (originalString: string | null) => string;
|
|
19
|
+
export declare const getLinkFragment: (text: string | null, id: string) => string;
|
package/dist/utils.d.ts
CHANGED
|
@@ -31,4 +31,5 @@ declare const replacePTagsInCodeBlocks: (html?: string) => string;
|
|
|
31
31
|
* @returns The processed HTML with standalone < characters escaped
|
|
32
32
|
*/
|
|
33
33
|
declare const escapeInvalidTagStarts: (html: string) => string;
|
|
34
|
-
|
|
34
|
+
declare const scrollAndHighlight: (element: HTMLDivElement, hash: string, hashAutoscrollTopMargin: number) => void;
|
|
35
|
+
export { toHtml, toSafeText, loadCodeFont, decodeHtmlEntities, getNearestRelativeParent, removeSpecialCharacters, addColorSpanAfterColorCodes, replacePTagsInCodeBlocks, escapeInvalidTagStarts, scrollAndHighlight, };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@happeouikit/content-renderer",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.4.0",
|
|
4
4
|
"description": "Rendering html and markdown content",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"jsnext:main": "dist/index.es.js",
|
|
@@ -39,5 +39,5 @@
|
|
|
39
39
|
"devDependencies": {
|
|
40
40
|
"@types/loadjs": "^4.0.4"
|
|
41
41
|
},
|
|
42
|
-
"gitHead": "
|
|
42
|
+
"gitHead": "988fda5e22e1e51360552a377dc2a8fa201a0871"
|
|
43
43
|
}
|