Skip to content
Free · MIT · v1.0.1

WDS Editor: a free WYSIWYG HTML editor with a file manager

Turn any textarea into a rich text editor with image upload, a built-in file manager, tables and clean HTML output. No paid add-ons, no API key, no tracking.

Live demo

The demo file manager reads a static files.json, so upload and delete are switched off here. Nothing you type leaves your browser.

Features

Free file manager

Folders, search, grid and list views, drag and drop upload, alt text, width and alignment. Works from a JSON list.

Images and captions

Resize with a corner handle, align left, center or right, and add a caption as figure and figcaption.

Tables

Size picker, header rows and columns, insert and delete rows, merge and split cells, Tab to the next cell.

Clean paste

Word and Google Docs noise is removed. Paste-as-text inserts plain paragraphs only.

Safe HTML

A strict schema drops scripts, event handlers and javascript: links from pasted and loaded HTML.

Themes and colors

Light, dark and auto themes, a small text color and highlight palette, English and Turkish UI.

Install

Add two files from the jsDelivr CDN and call WDSEditor.init. When the target is a <textarea>, the editor keeps it in sync, so a normal form post keeps working.

<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/wds-editor@1/dist/wds-editor.min.css">
<script src="https://cdn.jsdelivr.net/npm/wds-editor@1/dist/wds-editor.min.js"></script>

<form method="post">
  <textarea id="content" name="content"><p>Hello world</p></textarea>
  <button>Save</button>
</form>

<script>
  WDSEditor.init({ selector: '#content' });
</script>

Or install the package from npm (ES module and TypeScript types included):

npm install wds-editor
import { WDSEditor } from 'wds-editor';
import 'wds-editor/style.css';

const editor = WDSEditor.init({ selector: '#content' });

File manager

Most editors sell their file manager as a paid add-on. In WDS Editor it is free and needs only one URL that returns a JSON list. Upload and delete are optional.

WDSEditor.init({
  selector: '#content',
  fileManager: {
    listUrl: '/files/list',        // required: returns the JSON below
    uploadUrl: '/files/upload',    // optional: shows the Upload button
    deleteUrl: '/files/delete'     // optional: shows the Delete button
  }
});

GET listUrl?path=&q=&page= returns:

{
  "path": "/blog",
  "folders": [{ "name": "2026", "path": "/blog/2026" }],
  "files": [
    { "url": "/uploads/blog/team.jpg", "name": "team.jpg", "width": 1200, "height": 800, "size": 184320 }
  ],
  "hasMore": false
}
  • Only url and name are required for each file; a static files.json works too.
  • POST uploadUrl (multipart: file, path) returns { "file": { ... } }.
  • POST deleteUrl (JSON: { "url": "..." }) returns { "ok": true }.

Ready server examples are in the repository: Node.js, ASP.NET Core, PHP and static JSON. They keep paths inside the upload folder, allow only listed extensions, limit the size and never overwrite files. Add your own authentication before going live.

Options

OptionDefaultDescription
selector–CSS selector or element; a textarea is recommended.
height / minHeightauto / 240Fixed height, or the minimum height of an auto-growing editor.
placeholder–Text shown while the editor is empty.
languagebrowser"en", "tr" or your own messages.
theme"light""light", "dark" or "auto".
toolbardefaultA string like "bold italic | link image", an array, or false.
fileManager–listUrl, uploadUrl, deleteUrl, headers, accept.
colorsbuilt-in{ text: [...], highlight: [...] } with hex colors.
readOnlyfalseStarts in read-only mode.
onChange–(html, editor) => void

API

editor.getHTML();                  // clean HTML ("" when empty)
editor.setHTML('<p>Hi</p>');
editor.insertImage({ src: '/img/a.jpg', alt: 'A', width: 400, align: 'center' });
editor.openFileManager('image');
editor.on('change', (e) => console.log(e.getHTML()));
editor.on('upload', (e, file) => console.log('uploaded', file.url));

The full list of options, toolbar items and methods is in the README on GitHub.

Content Security Policy

The editor needs no inline scripts and no unsafe-eval. Colors and image alignment are written as style attributes, so a strict policy needs style-src 'self' 'unsafe-inline' on the page with the editor.

FAQ

Is WDS Editor really free?

Yes. The editor and its file manager are free and open source under the MIT license, also for commercial projects. There is no paid tier and no API key.

Do I need a special server for the file manager?

No. The file manager reads a simple JSON list. A static files.json works, and the GitHub repository has ready examples for Node.js, ASP.NET Core and PHP that add upload and delete.

Can I paste from Word or Google Docs?

Yes. Pasted content is cleaned automatically: office styles, classes and scripts are removed and headings, lists, tables and links are kept. A paste-as-text button inserts plain paragraphs only.

Is the HTML output safe?

The editor parses all HTML into a strict schema, so scripts, event handlers and javascript: links are dropped. Always sanitize the HTML on the server as well.

Which languages and themes are included?

English and Turkish, plus your own translations with WDSEditor.addLanguage. Light, dark and auto themes are built in and follow CSS variables.

License

WDS Editor is released under the MIT license. It is built on ProseMirror (MIT). A small “Powered by WDS Editor” link is shown under the editor; you can turn it off with branding: false.