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

Paragraph alignment is not handled #39

Open
alep85 opened this issue Jul 21, 2022 · 0 comments
Open

Paragraph alignment is not handled #39

alep85 opened this issue Jul 21, 2022 · 0 comments

Comments

@alep85
Copy link

alep85 commented Jul 21, 2022

Hi,
I'm using editor.js with a plugin that allows aligning paragraphs.
This plugin editorjs-paragraph-with-alignment generate the output data with alignment in addition to thetext:

Output data

Field Type Description
text string paragraph's text
alignment string left/center/right/justify
{
    "type" : "paragraph",
    "data" : {
        "text" : "Check out our projects on a <a href=\"https://github.com/codex-team\">GitHub page</a>.",
        "alignment": "left"
    }
}

Currently, the paragraph function adds only the text inside the tag p.

  paragraph: ({ data }) => {
    return `<p>${data.text}</p>`;
  }

I think it could be a good improvement to allow the parser check for alignment and set the paragraph text-align style with the alignment value.

@alep85 alep85 changed the title Paragraph alignment is not handle Paragraph alignment is not handled Jul 25, 2022
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