Skip to content

Commit

Permalink
Reduce WETness
Browse files Browse the repository at this point in the history
  • Loading branch information
OliverWales committed Jan 31, 2023
1 parent 0af7cca commit 8e96915
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 9 deletions.
17 changes: 10 additions & 7 deletions examples/src/EditableVoidsApp.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,13 @@ const plugins = createMyPlugins(
}
);

export default () => (
<Plate<MyValue>
editableProps={editableProps}
plugins={plugins}
initialValue={editableVoidsValue}
/>
);
export default () => {
console.log({ handlers: plugins.map((p) => p.handlers) });
return (
<Plate<MyValue>
editableProps={editableProps}
plugins={plugins}
initialValue={editableVoidsValue}
/>
);
};
8 changes: 6 additions & 2 deletions examples/src/placeholder/withStyledPlaceHolders.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
import { ELEMENT_H1, ELEMENT_PARAGRAPH, withPlaceholders } from '@udecode/plate'
import {
ELEMENT_H1,
ELEMENT_PARAGRAPH,
withPlaceholders,
} from '@udecode/plate';

export const withStyledPlaceHolders = (components: any) =>
withPlaceholders(components, [
Expand All @@ -12,4 +16,4 @@ export const withStyledPlaceHolders = (components: any) =>
placeholder: 'Untitled',
hideOnBlur: false,
},
])
]);
3 changes: 3 additions & 0 deletions packages/core/src/utils/misc/isUrl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ const nonLocalhostDomainRE = /^[^\s.]+\.\S{2,}$/;
* Loosely validate a URL `string`.
*/
export const isUrl = (string: any) => {
console.log('here');
if (typeof string !== 'string') {
return false;
}
Expand All @@ -33,6 +34,8 @@ export const isUrl = (string: any) => {
return false;
}

console.log('here 2');

return (
localhostDomainRE.test(everythingAfterProtocol) ||
nonLocalhostDomainRE.test(everythingAfterProtocol)
Expand Down

0 comments on commit 8e96915

Please sign in to comment.