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

Specifying the language of the written code #44

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

Al3bad
Copy link

@Al3bad Al3bad commented Apr 8, 2021

Hi,

Recently I was developing a blog for my website and I used Editor JS + code plugin as a text editor. There is only one thing missing, and that is specifying the language of the code written in the textarea. So, I’ve added this feature where if the user specified an array of languages in the config object, there will be a dropdown menu rendered that containing the languages.

Here is an example:

const editor = new EditorJS({
  holder: "editorjs",
  tools: {
    code: {
      class: CodeTool,
      config: {
        languages: ["HTML", "CSS", "Javascript"],
      },
    },
  },
});

And here are the screenshots of the component that was rendered and the output on saving:

image

image

image

@Al3bad Al3bad changed the title Specify language Specifying the language of the written code Apr 8, 2021
@MrMooky
Copy link

MrMooky commented Mar 9, 2022

Please merge this.

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

Successfully merging this pull request may close these issues.

2 participants