2

I am looking to writing a simple text editor in JavaScript. I am currently using a contenteditable div. But it seems very minimalistic and I am not sure if it is right component to use for a text editor. I looked at Atom and VS Code source, but I am not able to understand what they use as the base component for the editor. Could someone point me in the right direction? I could not find any html files in atom repository. Everything there is JavaScript. Where are the html files for the editor? Which component should I use as the base for a text editor (like Atom)?

John Doe
  • 2,225
  • 6
  • 16
  • 44

1 Answers1

2

VS code uses monaco editor npm link inside an electron app, U can use this module to build your editor.

Alternative to monaco are, Codemirror website link

These editors will give u intellisense, formatting, highligting out of the box.

However, building them from scratch will be difficult.

If you want to build a simple text editor, have a look at this github repo Pell text editor for source code.

More example of simple text editor

https://github.com/Alex-D/Trumbowyg

https://github.com/basecamp/trix

Gautam Naik
  • 8,990
  • 3
  • 27
  • 42