@happeouikit/content-renderer 3.4.3 → 3.4.5

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 CHANGED
@@ -2,18 +2,23 @@
2
2
  * Support unique ids for headers for new content
3
3
  *
4
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.
5
+ * New content should be automatically created with this type of id, but old content probably does not have any ids at all.
6
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
7
+ * If the element has this type of id then we generate links with hash such as #x1234321:~:headerText=MyHeaderSnippet
8
+ * The extra snippet at the end is ignored by everything, it's just for readability.
12
9
  *
10
+ * If there's no ID at all on the header, we'll use a real text fragment, such as #:~:text=My%20Header%20Snippet (which
11
+ * will scroll to the text but will not support duplicates of that text in the same document)
13
12
  */
14
13
  export declare const linkRandomIdRegex: RegExp;
15
14
  export declare const linkSnippetWithIdRegex: RegExp;
16
15
  export declare const getRandomLinkId: () => string;
16
+ /**
17
+ * This is outdated, we only used this between 2025-08 and 2025-09, but still some anchor links were created
18
+ * during this time period, so they'll use this format: #x1234567+MyHeaderSnippet
19
+ * (they will respond well when navigated to in a new tab/page, but not when remaining in the same tab and page)
20
+ */
17
21
  export declare const getLinkIdFromFragment: (fragment: string) => string;
18
22
  export declare const getLinkSnippet: (originalString: string | null) => string;
19
- export declare const getLinkFragment: (text: string | null, id: string) => string;
23
+ export declare const generateTextFragment: (element: Element) => string | null;
24
+ export declare const getLinkFragment: (element: Element) => string | null;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@happeouikit/content-renderer",
3
- "version": "3.4.3",
3
+ "version": "3.4.5",
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": "437a4ee8f7431a6c9f5e169b4126795b74968552"
42
+ "gitHead": "8307904823957aaa6b3ab5806e91d8359430cc76"
43
43
  }