GithubHelp home page GithubHelp logo

editorjs-php's People

Contributors

auchanhub avatar dzantiev avatar gohabereg avatar johnpuddephatt avatar khaydarov avatar n0str avatar nespecc avatar rendom avatar talyguryn avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

editorjs-php's Issues

Table configuration

Hello everyone,
I have added a table editor in next.js and PHP, but no documentation shows how to configure a table in editorjs-PHP.
If anyone can help I would be grateful

Saving Data

How would I save the output to a MySQL database?

[Bug][Link Tool] Add validation for 'style' and $field elements in $this->data

public function sanitize()
    {
        if (!empty($this->data['data']['style']) && $this->data['data']['style'] != 'smallCover' && $this->data['data']['style'] != 'bigCover') {
            $this->data['data']['style'] = 'smallCover';
        }

        foreach ($this->requredFields as $field => $allowedTags) {
            $sanitizer = clone $this->sanitizer;
            $purifier  = new HTMLPurifier($sanitizer);
            if ($allowedTags) {
                $sanitizer->set('HTML.Allowed', $allowedTags);
                $sanitizer->set('AutoFormat.RemoveEmpty', true);
            }

            if (isset($this->data['data'][$field])) {
                $this->data['data'][$field] = $purifier->purify($this->data['data'][$field]);
                $this->data['data'][$field] = trim($this->data['data'][$field]);
            }
        }
    }

Invalid validation result in validation process

I was meet with problem when i test my api - any types except "string" is recognized as invalid. eg. int, bool etc.
Here is example:
image
image
image

php v8.1.0
composer package:
"codex-team/editor.js": "dev-master",

Configuration File issue

I'm not able to set the configuration file. Every time it says configuration data is empty.
I'm using in laravel

Generate Final HTML

It's good to have a handy function that can generate HTML for generated blocked.

Ideally something like this: $editor->generateHtml($blocks = null) If blocks are provided it should generate html from the blocks supplied.

Not getting exception handling when using PHPUnit

I'm using this package in a Laravel 8 API app to handle data sent from the frontend. When I try to test my Controller using PHPunit, the exceptions are not being thrown UNLESS I go into your source code and directly dump() the exception.

For example:

foreach ($blockData as $key => $value) {
            if (!is_integer($key) && !isset($rules[$key])) {
                dump(throw new EditorJSException("Found extra param `$key`"));
            }
        }

The portion of my tests that tests this feature is

$response = $this->actingAs($author)->postJson(route('posts.store'), [
            'title' => $postToCreate->title,
            'content' => $postToCreate->content
        ]);

-

-

Block tunes API

It looks like the new Block Tunes API is unsupported by editorjs-php at present.

This adds 'tuning' data under the 'tunes' key so block data looks like the following:

"type": "paragraph",
"data": {
    "text": "Foo"
},
"tunes": {
    "textVariant": "small"
}

Recursive tool support?

I've been struggling to write a configuration for the nestedList tool plugin.

At first I thought the documentation said this was possible with "data" and "-".

But after looking at the example and struggling, I'm wondering if I misinterpreted the docs.

Has anybody successfully written a configuration for something like this

  • content1
  • content1.1
    • content2
"type": "nestedList", 
"data": {
    "style": "unordered",
    "items": [
            {
                "content": "content1",
                "items": []
            }, 
            {
                "content": "content1.1",
                "items": [
                    {
                        "content": "content2",
                        "items": []
                    }
                ]
        }
    ]
}

Generate Final HTML

It's good to have a handy function that can generate HTML for generated blocked.

Ideally something like this: $editor->generateHtml($blocks = null) If blocks are provided it should generate html from the blocks supplied.

Allow all tags

Добавить в конфиг возможность не вырезать теги конкретного плагина. Актуально для rawTool.

Invalid nested tools example in README.md

editorjs-php/README.md

Lines 187 to 207 in 9446738

### Nested tools
Tools can contain nested values. It is possible with the `array` type.
Let the JSON input be the following:
```
{
"blocks": [
"type": list,
"data": {
"items": [
"first", "second", "third"
],
"style": {
"background-color": "red",
"font-color": "black"
}
}
]
}
```

I think it should be...

{ 
     "blocks": [
         {
             "type": "list",
             "data": { 
                 "items": [ 
                     "first", "second", "third" 
                 ], 
                 "style": { 
                     "background-color": "red", 
                     "font-color": "black" 
                 } 
             } 
         }
     ] 
 } 

Delimiter Configuration File issue

Delimiter tool is creating errors during validation. The problem is I am not able to figure out the right configuration for it. Please help.

How to check empty string or null value?

For example, Image tool have a caption and it can be null or ''. How to skip such values?
My config:

"image": {
    ...
    "caption": {
        "type": "string",
        "required": false
    },
    ...
}

Now returns Option 'caption' with value `` must be string

Add image tool configuration

Add image tool configuration to sample or readme files. I checked all the project files, still I couldn't find this configuration.

Is this plugin dead?

Seems this hasn't been updated in a year. Is there an update being worked on?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.