Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JSON output instead of inline HTML #39

Open
Puspendert opened this issue Dec 30, 2024 · 0 comments
Open

JSON output instead of inline HTML #39

Puspendert opened this issue Dec 30, 2024 · 0 comments

Comments

@Puspendert
Copy link

Hello

Whole of the Editorjs creates output as raw JSON and no inline HTML is present. This helps in preventing XSS attacks. But with underline, the output text has inline HTML (sample below).

{
    "time": 1735526737550,
    "blocks": [
        {
            "id": "z5t-4fWC6H",
            "type": "paragraph",
            "data": {
                "text": "And I want to say that <u class=\"cdx-underline\">this is not fine</u> to work with."
            }
        }
    ],
    "version": "2.30.7"
}

Can we create output like below?

{

    "time": 1735526737550,
    "blocks": [
        {
            "id": "z5t-4fWC6H",
            "type": "paragraph",
            "data": {
                "items": [
                    {   
                        "id": "7-djd",
                        "style": null,
                        "text": "And I want to say that"
                    },
                    {
                        "id": "8-djd",
                        "style": underline,
                        "text": " this is not fine "
                    },
                    {
                        "id": "9-djd",
                        "style": null,
                        "text": "to work with."
                    },
                ]
            }
        }
    ],
    "version": "2.30.7"
}

This will help in preventing the XSS attacks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant