diff --git a/example/src/App.tsx b/example/src/App.tsx index 2856bb0..545e1ad 100644 --- a/example/src/App.tsx +++ b/example/src/App.tsx @@ -96,7 +96,8 @@ const tabs = [ 'Async initial value', 'React Hook Form', 'Read without editor', - 'Upload image' + 'Upload image', + 'Code block' ]; const mentions = [ @@ -166,6 +167,16 @@ const htmlToParse = ` `; +const code = ` +
export const suggestIndex = (query: string, data: Article[]) => {
+ const suggestions = data.filter((item: Article) => {
+ const maxDistance = item.title.length - leven(query.toLocaleLowerCase(), item.title.toLocaleLowerCase());
+ return maxDistance >= 6;
+ });
+ return suggestions;
+};
+`;
+
const App = () => {
const [tab, setTab] = useState