Skip to content

Commit

Permalink
Item11440: Item11378: merge from trunk (should be kept in lockstep)
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.foswiki.org/branches/Release01x01@14267 0b4bb1d4-4e5a-0410-9cc4-b2b747904278
  • Loading branch information
CrawfordCurrie authored and CrawfordCurrie committed Mar 9, 2012
1 parent cc6113f commit caf16b4
Show file tree
Hide file tree
Showing 11 changed files with 634 additions and 270 deletions.
24 changes: 2 additions & 22 deletions WysiwygPlugin/data/System/WysiwygPlugin.txt
Original file line number Diff line number Diff line change
Expand Up @@ -162,8 +162,6 @@ If %SYSTEMWEB%.TablePlugin is *not* enabled, then TML table cells containing onl

---+++ TinyMCEPlugin integration
%STARTSECTION{"tinymceintegration"}%
* Foswikitask:Item2174 - WysiwygPlugin removes line breaks
* Work-around: Use the =* Set NOWYSIWYG = 1= setting to disable WYSIWYG on line-sensitive topics
* Foswikitask:Item1396 - Anchors are not handled by WysiwygPlugin
* Foswikitask:Item5955 - WysiwygPlugin fails to roundtrip tables with align="center", border attributes, etc.
* Description: Sometimes tables will fail to be converted to TML syntax (will stay as HTML) because there are attributes on the table (such as alignment or border decorations) that WysiwygPlugin does not know how to preserve. If such attributes are necessary, please use [[VarTABLE]] instead.
Expand All @@ -190,7 +188,7 @@ Many thanks to the following sponsors for supporting this work:
| Version: | %$VERSION% |
| Release: | %$RELEASE% |
| Change History: | |
| 1.1.5 (31 Mar 2012) | Foswikitask:Item11603: protect inline script and style tags from wysiwyg |
| 1.1.5 (31 Mar 2012) | Foswikitask:Item11603: protect inline script and style tags from wysiwyg. Foswikitask:Item11440: protect tags inside pre |
| 1.1.4 (28 Feb 2012) | Foswikitask:Item11378: support pass-through of DEL and INS tags |
| 1.1.3 (08 Nov 2011) | Foswikitask:Item2174: Fix WysiwygPlugin eating newlines inside =%MACRO{...}= expressions (Michael Tempest) |
| 1.1.2 (11 Apr 2011) | Version released with Foswiki 1.1.3. Only a minor change related to how the plugin is being upgraded |
Expand Down Expand Up @@ -219,25 +217,7 @@ Many thanks to the following sponsors for supporting this work:
| 03 Dec 2008 | Foswikitask:Item6041: fixed empty bullet list problem. Foswiki version |
| 22 Oct 2008 | Fixed TWikibug:Item5961 (emphasis), TWikibug:Item6089 (backslash in verbatim) |
| 07 Aug 2008 | Fixed TWikibug:Item5707 (mod_perl) |
| 03 Aug 2008 | TWiki 4.2.1 release version |
| 25 May 2008 | TWikibug:Item5457: TWikibug:Item5528: TWikibug:Item5626: using a debug simulation, I believe I have finally fixed all the complexities of using international character sets with the translator. |
| 13 Apr 2008 | TWikibug:Item4946: TWikibug:Item5530: I think I have finally fixed non-iso-8859-1 character sets. Painful. TWikibug:Item5393: removed spurious DIV generated by IE inside LI tags |
| 31 Mar 2008 | TWikibug:Item5314: TWikibug:Item5457: Fixed pickaxe mode for editing UTF-8. Characters above 255 are converted to entitites, which is a bit of a PITA, but at least it no longer corrupts topics. |
| 28 Mar 2008 | TWikibug:Item5294: fixed angle brackets in plain text and promoted sticky to be higher priority than any other tag, solving several problems in one go |
| 24 Jan 2008 | TWikibug:Item5257: remove extra spaces at end of Set lines |
| 20 Dec 2007 | TWikibug:Item5022: made TT font size same as verbatim. Had to add a new style to do it, as TMCE didn't want to play with TT or CODE tags. TWikibug:Item5138: post-conversion of 8-bit entities to characters to aid searching etc. |
| 19 Dec 2007 | TWikibug:Item4836: make the parser tolerant of META, so pasting OO docs works TWikibug:Item4969: autoclose BR and HR tags TWikibug:Item5132: fixed IMG tags TWikibug:Item5076: fixed line-sensitive TML embedded in tables |
| 08 Nov 2007 | TWikibug:Item4923: fixed blocking of table conversion due to empty attributes TWikibug:Item4936: An em embedded in an em was getting eaten TWikibug:Item4817: added typewriter text button TWikibug:Item4850: added font colour controls TWikibug:Item4645: added REST handlers for upload and fetching lists of attachments |
| 02 Nov 2007 | TWikibug:Item4903: corrected over-enthusiastive interpretation of ! as an escape |
| 21 Oct 2007 | TWikibug:Item4788: fixed unbalanced protect, which could cause loss of protected status TWikibug:Item4811: noautolink *looks* like an HTML construct but in fact is not; the tag is infact an "on-off" switch and does not imply any HTML structure, so cannot be converted to a DIV or a span, so has to be removed. TWikibug:Item4747: added <sticky> to try to overcome limitations in translation TWikibug:Item4831: added increased flexibility in deciding what HTML get converted to TML, and what does not. Analysed all the HTML4 tags to establish initial settings. TWikibug:Item4847: don't call non-existent function with older HTML::Parser releases TWikibug:Item4844: Saving a table from IE didn't convert it back to TML TWikibug:Item4855: table rows generated from TWiki variables were being eaten |
| 06 Oct 2007 | TWikibug:Item4700: fixed colspans TWikibug:Item4701: removed extra line between %TABLE and the table TWikibug:Item4705: fixed spacing around literal and verbatim blocks TWikibug:Item4706: merge adjacent verbatim blocks separated only by whitespace TWikibug:Item4712: fixed eating of noautolink and literal TWikibug:Item4763: list items spanning multiple lines fixed TWikibug:Item4867: released tml2html |
| 17 Sep 2007 | TWikibug:Item4647: TWikibug:Item4652: problems related to DIV fixed. TWikibug:Item4653: fixed multi-line twiki variables |
| 16 Sep 2007 | TWikibug:Item4630: polished up the way the secret string is done, to ensure synch between perl and JS. Item4622: added UTF-8 handling steps that fixup malformed UTF8 strings before presenting them to the editor (saves Moz) and stops the editor passing them back to TWiki (saves IE). Removed extra entity decoding steps that were causing problems. TWikibug:Item4629: fixed issues with verbatim, highlighted by previous mangling of this topic |
| 13 Sep 2007 | TWikibug:Item4613 cleaned up spurious message when navigating away TWikibug:Item4615 fixed incorrect rendering of emphasis next to br |
| 12 Sep 2007 | TWikibug:Item4604 Fixes to REST handler, and add ability to trigger HTML2TML conversion from a content comment alone (required for some editors) TWikibug:Item4588 fixes to conversion of double-character emphases |
| 07 Sep 2007 | TWikibug:Item4503 excess empty lines TWikibug:Item4486 no toc headers with unofficial syntax TWikibug:Item4560: empty lines lost TWikibug:Item4566: corrupted table on save TWikibug:Item4550 section tags being eaten |
| 04 Sep 2007 | TWikibug:Item4534 TWikibug:Item4535 fixed |
| See Subversion logs for earlier revisions ||
| See Subversion logs for earlier versions ||
| Dependencies: | %$DEPENDENCIES% |
| Plugin Home: | http://foswiki.org/Extensions/%TOPIC% |
| Support: | http://foswiki.org/Support/%TOPIC% |
Expand Down
4 changes: 2 additions & 2 deletions WysiwygPlugin/lib/Foswiki/Plugins/WysiwygPlugin/Constants.pm
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ our %ALWAYS_BLOCK = map { $_ => 1 }
HR ISINDEX MENU NOFRAMES NOSCRIPT OL P PRE TABLE UL );
our $ALWAYS_BLOCK_S = join( '|', keys %ALWAYS_BLOCK );

our $STARTWW = qr/^|(?<=[ \t\n\(\!])/om;
our $ENDWW = qr/$|(?=[ \t\n\,\.\;\:\!\?\)])/om;
our $STARTWW = qr/^|(?<=[ \t\n\(\!])|(?<=<p>)|(?<= <\/span>)/om;
our $ENDWW = qr/$|(?=[ \t\n\,\.\;\:\!\?\)])|(?=<\/p>)|(?=<span\b[^>]*> )/om;
our $PROTOCOL = qr/^(file|ftp|gopher|https?|irc|news|nntp|telnet|mailto):/;

# Colours with colour settings in DefaultPreferences.
Expand Down
19 changes: 10 additions & 9 deletions WysiwygPlugin/lib/Foswiki/Plugins/WysiwygPlugin/HTML2TML.pm
Original file line number Diff line number Diff line change
Expand Up @@ -52,15 +52,16 @@ of how to call it.
sub new {
my ($class) = @_;

#use handler method names to allow of subclassing of HTML2TML
my $this = new HTML::Parser(
start_h => [ \&_openTag, 'self,tagname,attr' ],
end_h => [ \&_closeTag, 'self,tagname' ],
text_h => [ \&_text, 'self,text' ],
comment_h => [ \&_comment, 'self,text' ],
declaration_h => [ \&_ignore, 'self' ],
start_document_h => [ \&_ignore, 'self' ],
end_document_h => [ \&_ignore, 'self' ],
default_h => [ \&_default, 'self,event,text' ]
start_h => [ '_openTag', 'self,tagname,attr' ],
end_h => [ '_closeTag', 'self,tagname' ],
text_h => [ '_text', 'self,text' ],
comment_h => [ '_comment', 'self,text' ],
declaration_h => [ '_ignore', 'self' ],
start_document_h => [ '_ignore', 'self' ],
end_document_h => [ '_ignore', 'self' ],
default_h => [ '_default', 'self,event,text' ]
);

$this = bless( $this, $class );
Expand Down Expand Up @@ -201,7 +202,7 @@ sub convert {

# Autoclose tags without waiting for a /tag
my %autoClose = map { $_ => 1 }
qw( area base basefont br col embed frame hr input link meta param );
qw( area base basefont br col embed frame hr input link meta param img );

# Support auto-close of the tags that are most typically incorrectly
# nested. Autoclose triggers when a second tag of the same type is
Expand Down
Loading

0 comments on commit caf16b4

Please sign in to comment.