editor-js / editorjs-php Goto Github PK
View Code? Open in Web Editor NEWPHP backend for Editor.js
Home Page: https://editorjs.io
License: MIT License
PHP backend for Editor.js
Home Page: https://editorjs.io
License: MIT License
Need to provide configurations synchronized with official EditorJS tools
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
How would I save the output to a MySQL database?
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]);
}
}
}
How can we have RTL support config for this package?
codex/codex.editor
I'm not able to set the configuration file. Every time it says configuration data is empty.
I'm using in laravel
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.
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
]);
A configuration file for appending custom tags to HTML Purifier
-
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"
}
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
"type": "nestedList",
"data": {
"style": "unordered",
"items": [
{
"content": "content1",
"items": []
},
{
"content": "content1.1",
"items": [
{
"content": "content2",
"items": []
}
]
}
]
}
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.
Добавить в конфиг возможность не вырезать теги конкретного плагина. Актуально для rawTool.
Избавиться от простыни в пользу понятных переменных
PR #59 assumes that the tunes data is within the block['data'] object, however editor.js outputs the tunes data not to block['data'] but to block['tunes']
const output = {
id,
type: tool,
data,
...!_.isEmpty(tunes) && {
tunes,
},
};
blocks.push(output);
Lines 187 to 207 in 9446738
I think it should be...
{
"blocks": [
{
"type": "list",
"data": {
"items": [
"first", "second", "third"
],
"style": {
"background-color": "red",
"font-color": "black"
}
}
}
]
}
The HTML Purifier link in the readme is incorrect. There is an "]" in the end of the url
Delimiter tool is creating errors during validation. The problem is I am not able to figure out the right configuration for it. Please help.
Hello, Author and all participants! Thanks for the code!
Please tell me how new components from the repositories will appear:
https://github.com/codex-team
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 to sample or readme files. I checked all the project files, still I couldn't find this configuration.
Seems this hasn't been updated in a year. Is there an update being worked on?
editorjs-php/EditorJS/BlockHandler.php
Line 261 in 36de3db
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.