Changeset 593487
- Timestamp:
- 09/01/2012 06:37:58 PM (14 years ago)
- Location:
- preserved-html-editor-markup/trunk
- Files:
-
- 3 edited
-
admin.js (modified) (2 diffs)
-
readme.txt (modified) (3 diffs)
-
sb_preserved_markup.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
preserved-html-editor-markup/trunk/admin.js
r590703 r593487 249 249 $('body').bind('afterPreWpautop', function(e, o) { 250 250 //On Switch to HTML & On save/update from Visual tab 251 252 251 //Now we replace all those temporary html comments with spaces and newlines 253 o.data = o.unfiltered.replace(/<\!--mep-nl-->/g, "\r\n").replace(/<\!--mep-tab-->/g, " "); 252 o.data = o.unfiltered; 253 254 //remove cdata tags that are injected by browser, they can also malform mep tags 255 o.data = o.data.replace(/\/\/ <!\[CDATA\[/g, ""); 256 o.data = o.data.replace(/[^-]mep-nl-->/g, "<!--mep-nl-->"); //fix new lines before and after script tags 257 o.data = o.data.replace(/<!--mep-nl[^-]/g, "<!--mep-nl-->"); 258 o.data = o.data.replace(/<!--mep-tab[^-]/g, "<!--mep-tab-->"); //corner case, user adds four spaces after an opening script tag... not likely 259 o.data = o.data.replace(/[^-]mep-tab-->/g, "<!--mep-tab-->"); //fix script blocks that are fully indented 260 o.data = o.data.replace(/\/\/ \]\]>/g, ""); 261 262 //now decode newlines and tabs 263 o.data = o.data.replace(/<\!--mep-nl-->/g, "\r\n").replace(/<\!--mep-tab-->/g, " "); 254 264 255 265 //Fix broken >, <, &, etc symbols when they exist inside quote marks inside tag elements … … 258 268 o.data = fix_intra_tag_content("<", o.data, "{-mep-lts}"); 259 269 o.data = fix_intra_tag_content("”", o.data, "{-mep-dbl-quote}", '"'); 260 o.data = fix_intra_tag_content("″", o.data, "{-mep-dbl-quote}", '"'); 270 o.data = fix_intra_tag_content("″", o.data, "{-mep-dbl-quote}", '"'); 271 272 //fix >, < last because `fix_intra_tag_content` relies on their symbol placement 261 273 o.data = o.data.replace(/{-mep-gts}/g, '>'); 262 274 o.data = o.data.replace(/{-mep-lts}/g, '<'); -
preserved-html-editor-markup/trunk/readme.txt
r591398 r593487 7 7 Stable tag: trunk 8 8 9 Preserves white space and developer edits in HTML tab AND WYSIWYG tab and adds support for HTML5 block anchor tags9 Preserves white space and developer edits in HTML tab AND WYSIWYG tab. Allows inline scripts and css, full JavaScript code blocks and adds support for HTML5 block anchor tags 10 10 11 11 == Description == … … 15 15 It also supports HTML5 Block Anchor tags, something that is currently not supported in WP even via any existing plugins. 16 16 17 Version 1.4 is just a minor patch release. User @denl noticed a problem with the plugin CataBlog which implements its own administrative management features by disabling the 'show_ui' flag for its custom post type. I was ignoring any custom post type that didn't have a GUI, but it was an unecessary filter that probably limited other plugins. This fix allows any post type that supports the TinyMCE editor to be "fixed" using the tools under Admin > Settings > Writing. 17 Version 1.5 will probably be the last version I release for a while since my daughter will be born soon. I've added support for full JavaScript code blocks in the HTML tab. They are compatible and preserved when switching to Visual mode. This rounds out the support for almost complete html preservation, with full use of the WYSIWYG editor. And you don't need to wrap comment codes around it per the recommendations located here: <http://codex.wordpress.org/Using_Javascript> but you can leave them in if you want. 18 19 Version 1.4 was just a minor patch release. User @denl noticed a problem with the plugin CataBlog which implements its own administrative management features by disabling the 'show_ui' flag for its custom post type. I was ignoring any custom post type that didn't have a GUI, but it was an unecessary filter that probably limited other plugins. This fix allows any post type that supports the TinyMCE editor to be "fixed" using the tools under Admin > Settings > Writing. 18 20 19 21 Since version 1.3 you can now use inline CSS and JavaScript in the HTML editor and everything should be preserved. To be clear, this applies to tags only, like `onclick` events and style definitions - not script blocks themselves. To enable this feature you must disable the `wptexturize` and `convert_chars` filters by adding the following code to your theme's `functions.php`: … … 41 43 The caveats that still remains are: 42 44 45 1. With script blocks added to your HTML markup, the right arrow key does not pass over them in the Visual Tab. You can down arrow over them however so this will likely never be addressed. 46 43 47 1. If you use the Paragraph tag setting for newlines there is a minor bug where it will only wrap your content in Paragraph tags if you specify Paragraph in the Format drop down or if you enter more than one paragraph of text. So if you just type one sentence and click save it will not wrap the content in Paragraph tags. I tried to fix this but ran out of my allotted time working on other core issues. Should be fixed in the next release. 44 48 -
preserved-html-editor-markup/trunk/sb_preserved_markup.php
r591398 r593487 8 8 Author: Marcus E. Pope, marcuspope 9 9 Author URI: http://www.marcuspope.com 10 Version: 1. 410 Version: 1.5 11 11 12 12 Copyright 2011 Marcus E. Pope (email : me@marcuspope.com)
Note: See TracChangeset
for help on using the changeset viewer.