Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ Lexical version:
Link to code example:

<!--
Please provide a CodeSandbox (https://codesandbox.io/s/new) or (https://stackblitz.com/github/facebook/lexical/tree/main/examples/react-plain-text?embed=1&file=src%2FApp.tsx&terminalHeight=0&ctl=1&showSidebar=0&devtoolsheight=0&view=preview), a link to a
Please provide a CodeSandbox (https://codesandbox.io/s/new) or (https://stackblitz.com/github/facebook/lexical/tree/main/examples/react-plain-text?file=src%2FApp.tsx&terminalHeight=0&ctl=1&showSidebar=0&devtoolsheight=0&view=preview), a link to a
repository on GitHub, or provide a minimal code example that reproduces the
problem. You may provide a screenshot of the application if you think it is
relevant to your bug report. Here are some tips for providing a minimal
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,8 @@ function Editor() {
```

Try it yourself:
- [Plain Text Example](https://stackblitz.com/github/facebook/lexical/tree/main/examples/react-plain-text?embed=1&file=src%2FApp.tsx&terminalHeight=0&ctl=1&showSidebar=0&devtoolsheight=0&view=preview)
- [Rich Text Example](https://stackblitz.com/github/facebook/lexical/tree/main/examples/react-rich?embed=1&file=src%2FApp.tsx&terminalHeight=0&ctl=1&showSidebar=0&devtoolsheight=0&view=preview)
- [Plain Text Example](https://stackblitz.com/github/facebook/lexical/tree/main/examples/react-plain-text?file=src%2FApp.tsx&terminalHeight=0&ctl=1&showSidebar=0&devtoolsheight=0&view=preview)
- [Rich Text Example](https://stackblitz.com/github/facebook/lexical/tree/main/examples/react-rich?file=src%2FApp.tsx&terminalHeight=0&ctl=1&showSidebar=0&devtoolsheight=0&view=preview)

## Development

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -384,6 +384,11 @@ describe('Markdown', () => {
html: '<p><b><strong style="white-space: pre-wrap;">Hello</strong></b><span style="white-space: pre-wrap;"> world</span></p>',
md: '**Hello** world',
},
{
html: '<p><b><strong style="white-space: pre-wrap;">Bold label:</strong></b><span style="white-space: pre-wrap;">&nbsp;Following paragraph text.</span></p>',
md: '**Bold label:**\u00A0Following paragraph text.',
skipExport: true,
},
{
html: '<p><i><b><strong style="white-space: pre-wrap;">Hello</strong></b></i><span style="white-space: pre-wrap;"> world</span></p>',
md: '***Hello*** world',
Expand Down
2 changes: 1 addition & 1 deletion packages/lexical-markdown/src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -444,7 +444,7 @@ export function transformersByType(transformers: Array<Transformer>): Readonly<{
}

export const PUNCTUATION_OR_SPACE = /[!-/:-@[-`{-~\s]/;
export const WHITESPACE = /[ \t\n\r\f]/;
export const WHITESPACE = /\s/;
export const PUNCTUATION = /[!"#$%&'()*+,\-./:;<=>?@[\]^_`{|}~]/;

const MARKDOWN_EMPTY_LINE_REG_EXP = /^\s{0,3}$/;
Expand Down
2 changes: 1 addition & 1 deletion packages/lexical-react/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Install `lexical` and `@lexical/react`:
npm install --save lexical @lexical/react
```

Below is an example of a basic plain text editor using `lexical` and `@lexical/react` ([try it yourself](https://stackblitz.com/github/facebook/lexical/tree/main/examples/react-plain-text?embed=1&file=src%2FApp.tsx&terminalHeight=0&ctl=1&showSidebar=0&devtoolsheight=0&view=preview)).
Below is an example of a basic plain text editor using `lexical` and `@lexical/react` ([try it yourself](https://stackblitz.com/github/facebook/lexical/tree/main/examples/react-plain-text?file=src%2FApp.tsx&terminalHeight=0&ctl=1&showSidebar=0&devtoolsheight=0&view=preview)).

```jsx
import {$getRoot, $getSelection} from 'lexical';
Expand Down
2 changes: 1 addition & 1 deletion packages/lexical-website/docs/concepts/serialization.md
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ type HTMLConfig = {

#### Example of a use case for the `html` Property for Import and Export Configuration:

[Rich text sandbox](https://stackblitz.com/github/facebook/lexical/tree/main/examples/react-rich?embed=1&file=src%2FApp.tsx&terminalHeight=0&ctl=1&showSidebar=0&devtoolsheight=0&view=preview)
[Rich text sandbox](https://stackblitz.com/github/facebook/lexical/tree/main/examples/react-rich?file=src%2FApp.tsx&terminalHeight=0&ctl=1&showSidebar=0&devtoolsheight=0&view=preview)

### Handling extended HTML styling

Expand Down
28 changes: 14 additions & 14 deletions packages/lexical-website/src/components/Gallery/galleryExamples.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export interface GalleryExample {
description: string;
/** Filter tags (e.g. 'opensource', 'favorite') */
tags: string[];
/** Query string appended to the StackBlitz embed URL */
/** Query string appended to the StackBlitz URL */
stackblitzQuery: string;
/**
* CSS selector to wait for before taking a screenshot.
Expand Down Expand Up @@ -64,15 +64,15 @@ export const galleryExamples: GalleryExample[] = [
description: 'Learn how to create an editor with Emojis',
dir: 'vanilla-js-plugin',
stackblitzQuery:
'embed=1&file=src%2Femoji-plugin%2FEmojiPlugin.ts&terminalHeight=0&ctl=0',
'file=src%2Femoji-plugin%2FEmojiPlugin.ts&terminalHeight=0&ctl=0',
tags: ['opensource', 'vanilla', 'emoji'],
title: 'EmojiPlugin',
waitForSelector: '[data-lexical-editor]',
},
{
description: 'Learn how to create an editor with Real Time Collaboration',
dir: 'react-rich-collab',
stackblitzQuery: 'ctl=0&file=src%2Fmain.tsx&terminalHeight=0&embed=1',
stackblitzQuery: 'ctl=0&file=src%2Fmain.tsx&terminalHeight=0',
tags: ['opensource', 'favorite', 'react', 'collab', 'toolbar'],
title: 'Collab RichText',
// Editor is inside iframes, so wait for the iframe elements instead
Expand All @@ -81,15 +81,15 @@ export const galleryExamples: GalleryExample[] = [
{
description: 'Learn how to create an editor with Tables',
dir: 'react-table',
stackblitzQuery: 'embed=1&file=src%2Fmain.tsx&terminalHeight=0&ctl=0',
stackblitzQuery: 'file=src%2Fmain.tsx&terminalHeight=0&ctl=0',
tags: ['opensource', 'react', 'tables', 'toolbar'],
title: 'TablePlugin',
waitForSelector: '[data-lexical-editor]',
},
{
description: 'Tables using the Extension architecture',
dir: 'extension-react-table',
stackblitzQuery: 'embed=1&file=src%2Fmain.tsx&terminalHeight=0&ctl=0',
stackblitzQuery: 'file=src%2Fmain.tsx&terminalHeight=0&ctl=0',
tags: ['opensource', 'extension', 'favorite', 'react', 'tables', 'toolbar'],
title: 'Extension: React Table',
waitForSelector: '[data-lexical-editor]',
Expand All @@ -98,7 +98,7 @@ export const galleryExamples: GalleryExample[] = [
description: 'SSR and hydration with Svelte 5 and the Extension API',
dir: 'extension-sveltekit-ssr-hydration',
stackblitzQuery:
'embed=1&file=src%2Froutes%2F%2Bpage.svelte&terminalHeight=0&ctl=0',
'file=src%2Froutes%2F%2Bpage.svelte&terminalHeight=0&ctl=0',
tags: ['opensource', 'svelte', 'ssr', 'extension', 'tailwind', 'simple'],
title: 'Extension: SvelteKit SSR',
viteConfig: 'vite.config.ts',
Expand All @@ -107,15 +107,15 @@ export const galleryExamples: GalleryExample[] = [
{
description: 'Mount React plugins into a vanilla JS Extension editor',
dir: 'extension-vanilla-react-plugin-host',
stackblitzQuery: 'embed=1&file=src%2Fmain.ts&terminalHeight=0&ctl=0',
stackblitzQuery: 'file=src%2Fmain.ts&terminalHeight=0&ctl=0',
tags: ['opensource', 'vanilla', 'react', 'extension', 'tailwind'],
title: 'Extension: React Plugin Host',
waitForSelector: '[data-lexical-editor]',
},
{
description: 'Split-view markdown WYSIWYG editor with live preview',
dir: 'markdown-editor',
stackblitzQuery: 'embed=1&file=src%2Fmain.tsx&terminalHeight=0&ctl=0',
stackblitzQuery: 'file=src%2Fmain.tsx&terminalHeight=0&ctl=0',
tags: [
'opensource',
'favorite',
Expand All @@ -132,7 +132,7 @@ export const galleryExamples: GalleryExample[] = [
{
description: 'Vanilla JS checklist editor with Extensions and Tailwind',
dir: 'extension-vanilla-tailwind',
stackblitzQuery: 'embed=1&file=src%2Fmain.ts&terminalHeight=0&ctl=0',
stackblitzQuery: 'file=src%2Fmain.ts&terminalHeight=0&ctl=0',
tags: ['opensource', 'vanilla', 'extension', 'tailwind', 'simple'],
title: 'Extension: Vanilla Tailwind',
waitForSelector: '[data-lexical-editor]',
Expand All @@ -141,7 +141,7 @@ export const galleryExamples: GalleryExample[] = [
description:
'AI-powered editor with paragraph generation and named entity recognition',
dir: 'agent-example',
stackblitzQuery: 'embed=1&file=src%2Fmain.tsx&terminalHeight=0&ctl=0',
stackblitzQuery: 'file=src%2Fmain.tsx&terminalHeight=0&ctl=0',
tags: [
'opensource',
'extension',
Expand All @@ -159,7 +159,7 @@ export const galleryExamples: GalleryExample[] = [
{
description: 'Chat interface with multiple rich text editor instances',
dir: 'website-chat',
stackblitzQuery: 'embed=1&file=src%2Fmain.tsx&terminalHeight=0&ctl=0',
stackblitzQuery: 'file=src%2Fmain.tsx&terminalHeight=0&ctl=0',
tags: [
'opensource',
'extension',
Expand All @@ -177,7 +177,7 @@ export const galleryExamples: GalleryExample[] = [
description:
'Notion-style editor with slash commands and drag-and-drop blocks',
dir: 'website-notion',
stackblitzQuery: 'embed=1&file=src%2Fmain.tsx&terminalHeight=0&ctl=0',
stackblitzQuery: 'file=src%2Fmain.tsx&terminalHeight=0&ctl=0',
tags: ['opensource', 'favorite', 'block', 'react', 'extension', 'tailwind'],
title: 'Notion-style block editor',
viteConfig: 'vite.config.ts',
Expand All @@ -186,7 +186,7 @@ export const galleryExamples: GalleryExample[] = [
{
description: 'Simple rich text input with hashtag support',
dir: 'website-rich-input',
stackblitzQuery: 'embed=1&file=src%2Fmain.tsx&terminalHeight=0&ctl=0',
stackblitzQuery: 'file=src%2Fmain.tsx&terminalHeight=0&ctl=0',
tags: [
'opensource',
'favorite',
Expand All @@ -202,7 +202,7 @@ export const galleryExamples: GalleryExample[] = [
{
description: 'Rich text editor with a formatting toolbar',
dir: 'website-toolbar',
stackblitzQuery: 'embed=1&file=src%2Fmain.tsx&terminalHeight=0&ctl=0',
stackblitzQuery: 'file=src%2Fmain.tsx&terminalHeight=0&ctl=0',
tags: [
'opensource',
'favorite',
Expand Down
Loading