• Do not register here on develop.twiki.org, login with your twiki.org account.
• Use View topic Item7848 for generic doc work for TWiki-6.1.1. Use View topic Item7851 for doc work on extensions that are not part of a release. More... Close
• Anything you create or change in standard webs (Main, TWiki, Sandbox etc) will be automatically reverted on every SVN update.
Does this site look broken?. Use the LitterTray web for test cases.

HTML pasted from a Windows machine often contains \r\n at the end of each line, with the usual

around the paragraph.

When I paste a block of text containing a long bold line, the bold line gets passed to HTML2TML as multiple lines, with the result that the bold line gets replaced multiple lines with a star at the beginning of the first line and end of the last line:

*first long line
last long line*

The HTML pasted from a Windows machine is thus broken.

Adding the line:

sub convert {
    my( $this, $text ) = @_;

    # SMELL: ought to convert to site charset

    # get rid of nasties
    $text =~ s/\n/ /g; # Needed on Windows

Eliminates this problem.

Perhaps someone else using a Windows based browser in conjunction with a Linux could test this? I am using Firefox on Windows XP talking to a Debian Sarge Dreamhost box.

To compensate for the \n needed at the end of the meta line, adding \n into following was also necessary to keep META separate from the text:

    $_[0] =~ s/<!--META_(\d+)_META-->/$rescue[$1-1]\n/g;

Maybe the original search should be for \r\n and in WYSIWYG.pm rather than HTML2TML.pm?

What original search? What is WYSIWYG.pm? -- CC


Newlines are a complete nightmare. They are retained because there are cases where they have to be retained in order to recover the original TML from HTML generated from TML. Blanket substitution is not a good strategy. Perhaps you could add something to Kupu to support smarter paste; I don't think this should be handled by the plugin.

Of course you could always try you "Needed on Windows" and then running the unit tests. They are pretty exhaustive, and if they pass, there's a good chance it would be OK.

CC

Collapsed into Item1041 and discarded. CC

ItemTemplate
Summary Pasting from a Windows machine better if you strip \n
ReportedBy MartinCleaver
Codebase

SVN Range

AppliesTo Extension
Component WysiwygPlugin
Priority Normal
CurrentState No Action Required
WaitingFor

Edit | Attach | Watch | Print version | History: r5 < r4 < r3 < r2 < r1 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r5 - 2005-11-29 - CrawfordCurrie
 
This site is powered by the TWiki collaboration platform Powered by PerlCopyright © 2008-2018 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback