Some table text where I did not hit enter | Some text where I hit enter before the text and tried to delete it again |
Some text where I hit enter in the middle to get two lines of text |
Some text where I hit shift enter to get a BR instead |
Index: test/unit/WysiwygPlugin/ExtendedTranslatorTests.pm =================================================================== --- test/unit/WysiwygPlugin/ExtendedTranslatorTests.pm (revision 7305) +++ test/unit/WysiwygPlugin/ExtendedTranslatorTests.pm (working copy) @@ -747,6 +747,20 @@ | Foo | a | HERE }, + { + name => 'Item5221_EatUnwantedParasInTableCells', + exec => $HTML2TML | $ROUNDTRIP, + html => <<'HERE', +<table cellspacing="1" cellpadding="0" border="1"> +<tr><th> a </th></tr> +<tr><td> <p>1</p> </td></tr> +</table> +HERE + tml => <<'HERE', +| *a* | +| 1 | +HERE + }, ]; sub compareTML_HTML { Index: lib/Foswiki/Plugins/WysiwygPlugin/HTML2TML/Node.pm =================================================================== --- lib/Foswiki/Plugins/WysiwygPlugin/HTML2TML/Node.pm (revision 7305) +++ lib/Foswiki/Plugins/WysiwygPlugin/HTML2TML/Node.pm (working copy) @@ -872,6 +872,9 @@ s/^($WC::NBSP|$WC::NBBR|$WC::CHECKn|$WC::CHECKs|$WC::CHECKw|$WC::CHECK1|$WC::CHECK2|$WC::TAB|\s)+//so; $td =~ s/(<br \/>|<br>|$WC::NBSP|$WC::NBBR|$WC::CHECKn|$WC::CHECKs|$WC::CHECKw|$WC::CHECK1|$WC::CHECK2|$WC::TAB|\s)+$//so; + # Item5221: Eat impossible-to-remove-in-TinyMCE <p>...</p> surrounding table + # cell content, created if a user hits the return key inside a table cell + $td =~ s/^<p>(.*)<\/p>$/$1/so; return $td; }-- PaulHarvey - 01 May 2010 Be careful not to destroy content like this, that has more than one <p> tag:
<table><tr><td> <p>Line one</p> <p>Line two</p> </td></tr></table>-- MichaelTempest - 01 May 2010 Fixed. -- MichaelTempest - 16 May 2010
Summary | Wysiwyg tables, very difficult to get rid of paragraph html tags in table cell |
ReportedBy | TWiki:Main.KennethLavrsen |
Codebase | 1.0.9, trunk |
SVN Range | TWiki-4.3.0, Sun, 30 Dec 2007, build 16120 |
AppliesTo | Extension |
Component | TinyMCEPlugin |
Priority | Normal |
CurrentState | Closed |
WaitingFor | |
Checkins | distro:81b85965a03d distro:1d013e8f76ea |
TargetRelease | minor |
ReleasedIn | 1.1.0 |