Integrates the WMD markdown editor in Symfony as another rich text editor.

Version 1.0.0 has been released and move to /branches/1 in the SVN repository.

A widget for sf 1.1 and 1.2 has been added to the plugin.

The WMD JS project has been forked by Jeff Atwood at stackoverflow.com so that the JS files hare not obfuscated anymore plus some performance improvements have been made.
I will create a new branch at /branches/2 in the SVN repository for a version 2 of the plugin using those new JS files.

Developers

License

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

sfWmdPlugin - A Symfony wrapper of Wmd, a wysiwym markdown editor

Author

License

Versions

This is Version 1 located in branches/1 in the SVN repository.
It uses mostly the orininal obfuscated files of WMD posted by John Fraser.

Version 2 is located in branches/2 in the SVN repository.
It uses the JS files of the forked WMD project by stackoverflow.com.
Git repo for the JS files at: git://github.com/derobins/wmd.git.

Prerequisites

PHP v 5.2.0+

Features

The plugin adds WMD as another choice for a rich text editor in Symfony
Use it exactly like FCKEditor or TinyMce.
For security, you can remove all HTML before saving a field to the database and use sfMarkdown to display it.

The editor offers wysiwym edition of the markdown syntax with live preview and syntax help.

Browser compatibility

Tested on IE 6 and 7, Firefox 2 and 3, Opera 9 on Windows.
According to the author, the WMD scripts should work with in recent versions of Firefox, Safari, Opera, Konqueror, and Camino, as well as IE6 and IE7.

Installation

Install plugin as usual.
Create a link or virtual directory called sfWmdPlugin, pointing to the web folder of the plugin.

The first line simply sets Wmd as rich text editor for the application. This is only required for the helper in Symfony 1.0, not for the widget.

The second line defines a Url where the user can browse and select an image to be incorporated in the editor.
When it is defined, a Browser Server button is added to the Add Image Dialog.
This Url should include a link to a JS callback function in the form:

window.opener.setUrl('url/of/image');

The third line allows you to define a template to overwrite the default markdown syntax help that shows in the plugin.
You can copy/paste the one located in the lib/helper folder of the plugin.

Options in wmd-options.js

The WMD options have to be passed in a js file which is included by the plugin.
The file is called wmd-options.js and has to be placed in the js folder of the web folder of your application. By default, it would be /web/js/wmd-options.js.
For options per editor instance, pass the file name in the helper function options.