Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(core): support fragments with
insertHtml
(#965)
- Loading branch information
Showing
20 changed files
with
472 additions
and
130 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
--- | ||
'@remirror/extension-markdown': minor | ||
--- | ||
|
||
Add new `insertMarkdown` command. | ||
|
||
```ts | ||
commands.insertMarkdown('# Heading\nAnd content'); | ||
// => <h1 id="heading">Heading</h1><p>And content</p> | ||
``` | ||
|
||
The content will be inlined by default if not a block node. | ||
|
||
```ts | ||
commands.insertMarkdown('**is bold.**'); | ||
// => <strong>is bold.</strong> | ||
``` | ||
|
||
To always wrap the content in a block you can pass the following option. | ||
|
||
```ts | ||
commands.insertMarkdown('**is bold.**', { alwaysWrapInBlock: true }); | ||
// => <p><strong>is bold.</strong></p> | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'@remirror/core': patch | ||
--- | ||
|
||
Fix [#962](https://github.com/remirror/remirror/issues/962) so that inline html can now be added via `commands.insertHtml()`. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'@remirror/core-utils': minor | ||
--- | ||
|
||
Add support for the ProseMirror `Fragment` to the `StringHandlerOptions` in `@remirror/core-utils`. Now passing the option `fragment: true` to any string handler will return a `Fragment` rather than a `Node`. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 18 additions & 0 deletions
18
packages/remirror__core/__tests__/__snapshots__/helpers-extension.spec.ts.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`commands.insertHtml can insert marks 1`] = ` | ||
<div | ||
aria-label="" | ||
aria-multiline="true" | ||
class="ProseMirror remirror-editor" | ||
contenteditable="true" | ||
role="textbox" | ||
> | ||
<p> | ||
Content | ||
<strong> | ||
is bold. | ||
</strong> | ||
</p> | ||
</div> | ||
`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.