Open source rich text editor based on HTML5 and the progressive-enhancement approach. Uses a sophisticated security concept and aims to generate fully valid HTML5 markup by preventing unmaintainable tag soups and inline styles.

Related tags

Editors wysihtml5
Overview

This project isn’t maintained anymore

Please check out this fork.

wysihtml5 0.3.0

wysihtml5 is an open source rich text editor based on HTML5 technology and the progressive-enhancement approach.
It uses a sophisticated security concept and aims to generate fully valid HTML5 markup by preventing unmaintainable tag soups and inline styles.
The code is completely library agnostic: No jQuery, Prototype or similar is required.

This project was initiated and is supported by the XING AG. Thanks!

Features

  • Auto linking of urls as-you-type
  • Generates valid and semantic HTML5 markup (no <font>)
  • Uses class-names instead of inline styles
  • Unifies line-break handling across browsers (hitting enter will create <br> instead of <p> or <div>)
  • Auto-parses content inserted via copy & paste (from Word, Powerpoint, PDF, other web pages, …)
  • Converts invalid or unknown html tags into valid/similar tags
  • Source code view for users with HTML skills
  • Uses sandboxed iframes in order to prevent identity theft through XSS
  • Editor inherits styles and attributes (placeholder, autofocus, …) from original textarea (you only have to style one element)
  • Speech-input for Chrome

Browser Support

The rich text editing interface is supported in IE8+, FF 3.5+, Safari 4+, Safari on iOS 5+, Opera 11+ and Chrome.
Graceful Degradation: Users with other browsers will see the textarea and are still able to write plain HTML by themselves.

Demos

Companies using wysihtml5

  • Basecamp – Leading web-based project management and collaboration tool
  • XING – Business Social Network with more than 12 million members
  • Qype – Largest user-generated local review site in Europe
  • and many more …

Wiki

Check our Wiki Pages including a simple Getting Started Tutorial.

Research

Before starting wysihtml5 we spent a lot of time investigating the different browsers and their behaviors.

Check this repository:
https://github.com/tiff/wysihtml5-tests

A compatibility table for rich text query commands can be found here:
http://tifftiff.de/contenteditable/compliance_test.html

A pure native rich text editor with HTML validator and live source preview is here:
http://tifftiff.de/contenteditable/editor.html

Contributors

Comments
  • Paragraphs are <br>s

    Paragraphs are
    s

    A paragraph should return a paragraph, not a bunch of <br>. This is terribly unsemantic and will make global CSS changes for "paragraphs" nearly impossible.

    Currently:

    Paragraph 1
    <br>
    <br>
    P2
    <br>
    line break on P2
    

    Should be:

    <p>Paragraph 1</p>
    <p>P2<br>line break on P2</p>
    
    opened by OscarGodson 94
  • Consider a more permissive license

    Consider a more permissive license

    wysihtml5 looks very promising! I'd love to integrate it as another editor option in Create. However, Create is licensed under MIT and wysihtml5 under the more strict GPL. This would prevent me from distributing the editor, and most implementors from using it.

    It would be great if the editor could at least be dual-licensed.

    opened by bergie 31
  • wysihtml5 focus/click iphone

    wysihtml5 focus/click iphone

    Hi Christopher,

    First thanks for this rich text editor which is very good !

    Secondly, i'm trying to make the focus work on an iphone ... seems too hard for me :/

    To simulate the click event (safari ios don't work with focus(), it seems that we have to simulate a click event to make the iphone keyboard appear), I've tried this :

    • "document.getElementsByClassName("wysihtml5-sandbox")[0].contentWindow.document.body.click();"
    • This jquery trick : $(".wysihtml5-editor").show().focus().click().hide();

    But nothing is working ...

    Maybe you have a solution for that ?

    Thanks in advance,

    François.

    opened by brainztorm 16
  • Using Typekit / Web Font Services

    Using Typekit / Web Font Services

    Hey there,

    I'm trying to using fonts provided by Typekit with wysihtml5. Typekit works by pulling down a CSS file that is authenticated by the referrer. I'm inserting that CSS request in the iframe, however because the src is blank, the referrer header is blank. Is there a good way around this or is the blank iframe too integral in the design?

    Thanks!

    opened by woodbridge 14
  • bold and Italic

    bold and Italic

    Although <b> and <i> are very much a part of the HTML5 spec they no longer mean 'Bold' and 'Italic'. So UI icons representing bold and italic need to use <strong> and <em>.

    <b> according to the spec is used to make text “stylistically offset from the normal prose without conveying any extra importance. <i> represents text that’s “in an alternate voice or mood, or otherwise offset from the normal prose”

    this article sums it up well http://www.impressivewebs.com/bold-italic-html5/

    opened by MattFielding 14
  • Chrome doesn't load stylesheets when wysihtml-code-snippet is loaded dynamically

    Chrome doesn't load stylesheets when wysihtml-code-snippet is loaded dynamically

    Webkit-based browsers fail to load a stylesheet given as option to wysihtml5.Editor in some cases.

    Here's our code:

    var editor = new wysihtml5.Editor("wysihtml5-textarea", {
            toolbar: "wysihtml5-toolbar",
            parserRules: wysihtml5ParserRules,
            style: false,
            stylesheets: ['/assets/textile_preview.css']
    });
    

    The DOM fragment with the above JS is loaded via AJAX and then inserted into the DOM. We suspect this may cause is the problem.

    Some observations:

    • wysihtml correctly triggers the load of the stylesheet, but the Chrome web inspector shows the request as canceled. The response body is empty, and the iframe isn't styled.
    • the server-side log shows a successful GET request for the file.
    • this happens with every CSS file, even with an empty one.
    • using the Chrome debugger we can see that Chrome stops/fails when parsing the response headers. At first we thought our Rails app sends a strange header. But this happens in our staging and production environments as well, where the static CSS file is served by Apache.

    I'm testing on OS X with current Chrome (23.0.1271.64). Safari behaves the same, so it seems to be a Webkit problem. It works in Firefox.

    Any ideas? Have you heard of this before? Any help would be appreciated.

    opened by phillipoertel 12
  • is there a way to allow all tags and attributes?

    is there a way to allow all tags and attributes?

    I don't want to filter anything, right now it seems like it replace span with divs, remove src values and style attributes. Is there a way to just allow anything?

    Thanks

    opened by patcito 12
  • Image Upload

    Image Upload

    How about an image upload?

    Let me propose a situation:

    • A client (with basic almost none knowledge) needs to upload an image from her/him computer to the server. How can I develop a plugin (or anything like that) for that?

    With you need some help for PHP developing, I can help you. When I have more free time, I'll fork your project and try to play around, but first I really want to know if there's something already done.

    Thanks and 5 stars for your work, keep going :)

    opened by elrafael 11
  • focus the editor via javascript

    focus the editor via javascript

    I'd like to set the focus to the wysi editor via javascript. I already saw that in issue #213 somebody found a solution to this problem. Unfortunately that didn't work for me.

    I also tried triggering the focus event on various elements in the wysi editor object but I couldn't find the right one. Among them the following:

    editor.composer.element.focus()
    editor.fire('focus')
    editor.fire('focus:textarea')
    editor.fire('focus:composer')
    

    Is there any official way of achieving that?

    opened by stmichael 10
  • Please add image alignment and sizing :)

    Please add image alignment and sizing :)

    One function that (nearly) all WYSIWYG editors lack is simple image alignment and sizing tools. It would be really great if wysihtml5 had

    a) Image resizing by dragging corners b) Image alignment

    Please see here for an example of how I think it should be done: http://ghosted.it/demo

    (Ghosted.it looked promising initially but the project appears to be dead)

    opened by marcusgreenwood 10
  • Iframe optional

    Iframe optional

    The iframe does not seems to be optional, i've hacked quite a lot to replace it by a div.

    Is it possible in a next release to make it optional?

    Thank you

    opened by julesbou 10
  • Cannot remove custom color.

    Cannot remove custom color.

    I just found the website here: http://xing.github.io/wysihtml5/ I selected the first word after the headline ("wysihtml5") and made it red by hovering over the toolbar and clicking the red color. There seems to be no way to turn it black again. (Ok, I can press Ctrl-Z, I can edit the HTML sourcecode, but both options feel like cheating. There should be a way to select text and make it black.)

    A simple black color option in the color menu would help, but there is no black color in the menu.

    opened by michaelpeternell 1
  • Android native and Chrome browser error in console: Uncaught TypeError: Cannot read property 'contentDocument' of undefined

    Android native and Chrome browser error in console: Uncaught TypeError: Cannot read property 'contentDocument' of undefined

    I'm getting Uncaught TypeError: Cannot read property 'contentDocument' of undefined in Android native and Google Chrome browser using wysihtml5 v0.3.0

    Test device details: SAMSUNG GALAXY NOTE 4 Chrome version 58.0.3029.83

    It works fine on firefox.

    opened by benomatis 0
  • set different heading styles in same line

    set different heading styles in same line

    Editor works properly and I can change heading style for any line . my issue is that I can't change header in the same line . each line only can get one heading style.

    is there any solution for this issue?

    opened by AhmedEmadAhmed 0
  • How to add multiple rich text editors?

    How to add multiple rich text editors?

    Hi! I was wondering, how do you add multiple rich text editors on one page? I have the problem where if I have multiple rich text editors, the same text appears in both of the same boxes when I refresh the page, even if I typed different things. I'm trying to create a rich text editor for a text section and a caption section. Is there something I'm doing wrong in the code below?

    $('iframe.wysihtml5-sandbox').contents().find('body').html(data.text.text); $('iframe.wysihtml5-sandbox').contents().find('body').html(data.media.caption);

    opened by rosaliechan 0
Owner
Christopher Blum
Entrepreneurial Developer, Y Combinator W16
Christopher Blum
Medium.com WYSIWYG editor clone. Uses contenteditable API to implement a rich text solution.

If you would be interested in helping to maintain one of the most successful WYSIWYG text editors on github, let us know! (See issue #1503) MediumEdit

yabwe 15.7k Jan 4, 2023
Override the rich text editor in Strapi admin with ToastUI Editor.

strapi-plugin-wysiwyg-tui-editor ⚠️ This is a strapi v4 plugin which does not support any earlier version! A Strapi plugin to replace the default rich

Zhuo Chen 12 Dec 23, 2022
HTML5 rich text editor. Try the demo integration at

Squire Squire is an HTML5 rich text editor, which provides powerful cross-browser normalisation in a flexible lightweight package (only 16.5KB of JS a

Neil Jenkins 4.4k Dec 28, 2022
Popline is an HTML5 Rich-Text-Editor Toolbar

popline Popline is a non-intrusive WYSIWYG editor that shows up only after selecting a piece of text on the page, inspired by popclip. Usage Load jQue

kenshin 1k Nov 4, 2022
Typewriter is a simple, FOSS, Web-based text editor that aims to provide a simple and intuitive environment for you to write in.

Typewriter Typewriter is a simple, FOSS, Web-based text editor that aims to provide a simple and intuitive environment for you to write in. Features S

Isla 2 May 24, 2022
Verbum is a fully flexible text editor based on lexical framework.

Verbum Verbum - Flexible Text Editor for React Verbum is a fully flexible rich text editor based on lexical-playground and lexical framework. ⚠️ As th

Ozan Yurtsever 560 Dec 29, 2022
A modern, simple and elegant WYSIWYG rich text editor.

jQuery-Notebook A simple, clean and elegant WYSIWYG rich text editor for web aplications Note: Check out the fully functional demo and examples here.

Raphael Cruzeiro 1.7k Dec 12, 2022
Simple rich text editor (contentEditable) for jQuery UI

Hallo - contentEditable for jQuery UI Hallo is a very simple in-place rich text editor for web pages. It uses jQuery UI and the HTML5 contentEditable

Henri Bergius 2.4k Dec 17, 2022
Tiny bootstrap-compatible WISWYG rich text editor

bootstrap-wysiwyg Important information for Github requests/issues Please do not submit issues/comments to this repo. Instead, submit it to https://gi

MindMup 5.6k Jan 3, 2023
A rich text editor for everyday writing

Trix A Rich Text Editor for Everyday Writing Compose beautifully formatted text in your web application. Trix is a WYSIWYG editor for writing messages

Basecamp 17.3k Jan 3, 2023
A powerful WYSIWYG rich text web editor by pure javascript

KothingEditor A powerful WYSIWYG rich text web editor by pure javascript Demo : kothing.github.io/editor The KothingEditor is a lightweight, flexible,

Kothing 34 Dec 25, 2022
The world's #1 JavaScript library for rich text editing. Available for React, Vue and Angular

TinyMCE TinyMCE is the world's most advanced open source core rich text editor. Trusted by millions of developers, and used by some of the world's lar

Tiny 12.4k Jan 4, 2023
A completely customizable framework for building rich text editors. (Currently in beta.)

A completely customizable framework for building rich text editors. Why? · Principles · Demo · Examples · Documentation · Contributing! Slate lets you

Ian Storm Taylor 26.2k Dec 30, 2022
Collection of tools for building rich text editors.

psst we have great documentation at https://bangle.dev What is bangle.dev ? bangle.dev is a collection of components for building powerful editing exp

null 553 Dec 29, 2022
The best enterprise-grade WYSIWYG editor. Fully customizable with countless features and plugins.

CKEditor 4 - Smart WYSIWYG HTML editor A highly configurable WYSIWYG HTML editor with hundreds of features, from creating rich text content with capti

CKEditor Ecosystem 5.7k Dec 27, 2022
Markup note-taking app

Noteup Live version A web and desktop markup notes app. Noteup is a free, open-source markup notes app for the web, mobile(PWA) and desktop. Your note

Elements 14 Dec 2, 2022
A markdown editor. http://lab.lepture.com/editor/

Editor A markdown editor you really want. Sponsors Editor is sponsored by Typlog. Overview Editor is not a WYSIWYG editor, it is a plain text markdown

Hsiaoming Yang 2.8k Dec 19, 2022
A chrome extension which helps change ace editor to monaco editor in web pages, supporting all features including autocompletes.

Monaco-It Monaco-It is a chrome extension turning Ace Editor into Monaco Editor, supporting all features including autocompletes. 一些中文说明 Supported Lan

null 3 May 17, 2022
Example VS Code plugin that uses embedded Omega Edit bindings to generate content

Ωedit Edit for VS Code Example VS Code plugin that uses embedded Omega Edit bindings to generate content. Build Requirements Bindings compiled against

Concurrent Technologies Corporation (CTC) 2 Nov 17, 2022