Skip to content

Commit

Permalink
came to the conclusion the last update was unnecessary and deleted th…
Browse files Browse the repository at this point in the history
…e changes but simple-image is still supported.
  • Loading branch information
miadabdi committed Dec 24, 2020
1 parent d5a05ab commit 42f816e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 20 deletions.
16 changes: 2 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,8 @@ const markup = parser.parseBlock(block);
- Image
- Simple-image

**NOTE:** It is pointless to use both `image` and `simple-image` block types in the same editor insatnce, but this parser supports both of them and you can use any of them that fulfills your needs.

## Custom or overriding parser methods

If you have a custom block like so:
Expand Down Expand Up @@ -156,20 +158,6 @@ const parser = new edjsParser(config);

You can style, according to these classes.

**NOTE:** To use `image` block and `simple-image` block together, you should set the imported `simple-image` module to `simpleImage` key in `tools` and `image` module to `image` key:

```javascript
var editor = EditorJS({
...
tools: {
...
simpleImage: SimpleImage,
image: ImageTool
}
...
});
```

### Apply provided lengths (embeds)

If you want the returned width and height of embeded element to be applied, set `useProvidedLength` option to true in config:
Expand Down
6 changes: 0 additions & 6 deletions src/parsers.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,6 @@ export default {
});
return `<table><tbody>${rows.join("")}</tbody></table>`;
},
simpleImage: function(data, config) {
// this is added for the ability to use both image and simple-image block types
// when initializing the Editorjs editor block, you should set imported simple-image
// to simpleImage key, so it would call this function.
return this.image(data, config);
},
image: function (data, config) {
const imageConditions = `${data.stretched ? "img-fullwidth" : ""} ${
data.withBorder ? "img-border" : ""
Expand Down

0 comments on commit 42f816e

Please sign in to comment.