djangosnippets.org: Latest snippets tagged with 'wysiwyg'https://djangosnippets.org/tags/wysiwyg/2011-08-31T12:31:58.974034-05:00Django filter stack to cleanup WYSIWYG output
2011-08-31T12:31:58.974034-05:00jbergantinehttps://djangosnippets.org/snippets/2535/<p>Django Template Tag Filter stack to clean up output from <a href="http://www.themaninblue.com/experiment/widgEditor/">widgEditor</a> or other WYSIWYG text-input box. Removes arbitrary line break code and replaces with Django's cleaner <code>|linebreaks</code> filter. Also removes any arbitrary styling, leaving in things like bold, italic, link and image tags.</p>
Freely redistributableTinyMCE Widget
2009-08-28T14:56:18.952333-05:00sementehttps://djangosnippets.org/snippets/1705/<p>Widget for TinyMCE 3.2.6, a WYSIWYG HTML editor for <code>textarea</code>.</p>
<p><strong>Note:</strong></p>
<blockquote>
<p>This snippet uses the TinyMCE package thats contains special jQuery build of TinyMCE and a jQuery integration plugin. Anyway, is easily to adapt to standard package.</p>
</blockquote>
<p>Usage example:</p>
<pre><code>from django.contrib.flatpages.admin import FlatpageForm
class MyFlatPageForm(FlatpageForm):
content = forms.CharField(widget=TinyMCEEditor())
</code></pre>
<p><a href="http://tinymce.moxiecode.com/download.php">TinyMCE …</a></p>
Freely redistributableCleanup dirty HTML from a WYSIWYG editor
2009-05-29T09:57:37.422670-05:00denishttps://djangosnippets.org/snippets/1536/<p>My admin allows editing of some html fields using TinyMCE, so I end up with horrible code that contains lots of nested <code><p></code>, <code><div></code>, <code><span></code> tags, and style properties which destroy my layout and consistence.</p>
<p>This tag based on lxml tries to kill as much unneeded tags as …</p>
Freely redistributableSanitize text field HTML (here from the Dojo Toolkit Editor2 widget)
2007-04-10T14:11:42.561665-05:00akaiholahttps://djangosnippets.org/snippets/169/<p>When using a JavaScript WYSIWYG editor widget for text area content, the resulting HTML should be sanitized so no unallowed HTML tags (esp. script tags) are present.</p>
<p>The <a href="http://www.crummy.com/software/BeautifulSoup/">BeautifulSoup</a> library handles HTML processing in the solution presented above, so you should place it in the Python path.</p>
<p>The snippet also …</p>
Freely redistributable