Index: trunk/extensions/UsabilityInitiative/js/plugins/jquery.wikiEditor.js |
— | — | @@ -260,7 +260,7 @@ |
261 | 261 | switch ( event.type ) { |
262 | 262 | case 'keypress': |
263 | 263 | if ( /* TODO: test if something interesting was deleted */ true ) { |
264 | | - event.data.scope = 'division'; |
| 264 | + event.data.scope = 'keydown'; |
265 | 265 | } else { |
266 | 266 | event.data.scope = 'character'; |
267 | 267 | } |
— | — | @@ -386,7 +386,13 @@ |
387 | 387 | } |
388 | 388 | // We use .html() instead of .text() so HTML entities are handled right |
389 | 389 | // Setting the HTML of the textarea doesn't work on all browsers, use a dummy <div> instead |
390 | | - return $( '<div />' ).html( context.$content.html().replace( /\<br\>/g, "\n" ) ).text(); |
| 390 | + |
| 391 | + |
| 392 | + //get rid of the noincludes when getting text |
| 393 | + var $dummyDiv = $( '<div />' ).html( context.$content.html().replace( /\<br\>/g, "\n" ) ); |
| 394 | + $dummyDiv.find( ".wiki-editor-noinclude" ).each( function() { $( this ).remove(); } ); |
| 395 | + return $dummyDiv.text(); |
| 396 | + |
391 | 397 | }, |
392 | 398 | /** |
393 | 399 | * Sets the complete contents of the iframe (in plain text, not HTML; HTML passed will be converted to entities) |