5htp-core 0.4.9-91 → 0.4.9-92

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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "5htp-core",
3
3
  "description": "Convenient TypeScript framework designed for Performance and Productivity.",
4
- "version": "0.4.9-91",
4
+ "version": "0.4.9-92",
5
5
  "author": "Gaetan Le Gac (https://github.com/gaetanlegac)",
6
6
  "repository": "git://github.com/gaetanlegac/5htp-core.git",
7
7
  "license": "MIT",
@@ -18,8 +18,14 @@ export const Link = ({ to, ...props }: {
18
18
  className?: string
19
19
  } & React.HTMLProps<HTMLAnchorElement>) => {
20
20
 
21
+ const openNewTab = to && (
22
+ !['/', '#'].includes(to[0])
23
+ ||
24
+ to.startsWith('//')
25
+ );
26
+
21
27
  // External = open in new tab by default
22
- if (to && (to[0] !== '/' || to.startsWith('//')))
28
+ if (openNewTab)
23
29
  props.target = '_blank';
24
30
  // Otherwise, propagate to the router
25
31
  else
@@ -42,7 +42,7 @@ const PlaygroundNodes: Array<Klass<LexicalNode>> = [
42
42
  {
43
43
  replace: HeadingNode,
44
44
  with: (node) => {
45
- return new HeadingWithAnchorNode( node.getTag(), node.__key );
45
+ return new HeadingWithAnchorNode( node.getTag() );
46
46
  }
47
47
  },
48
48
  ListNode,