Announcement

Do not use the forums to submit bug reports, feature requests or patches, submit a New Ticket instead.

#1 2007-04-02 09:04:28

theCrank
New member
From: Germany, Karlsruhe
Registered: 2007-04-02
Posts: 2

Lot's of LFs and tabs -> getHTML()

Hi there,

I've integrated xinha into a project i'm working on (replacing TinyMCE - uuurggg!) and stumbled upon something strange: When i call getHTML() there are a lot of tabs and linefeeds at the end of the string. Here's an example (escaped via javscript: escape()).

%0Atest%0A%09%09%0A%09%09%0A%09%09%0A%09%09%0A%09%09%0A%09%09%0A%09%09%0A%09%09%0A%09%09%0A%09%09%0A%09%09%0A%09%09%0A%09%09%0A%09%09%0A%09%0A%09%09%0A%09%09%0A%09%09%0A%09%09%0A%09%09%0A%09%09%0A%09%09%0A%09%09%0A%09%09%0A%09%09%0A%09%09%0A%09%09%0A%09%09%0A%09%09%0A%09%0A%09%09%0A%09%09%0A%09%09%0A%09%09%0A%09%09%0A%09%09%0A%09%09%0A%09%09%0A%09%09%0A%09%09%0A%09%09%0A%09%09%0A%09%09%0A%09%09%0A%09%0A%09%09%0A%09%09%0A%09%09%0A%09%09%0A%09%09%0A%09%09%0A%09%09%0A%09%09%0A%09%09%0A%09%09%0A%09%09%0A%09%09%0A%09%09%0A%09%09%0A%09%0A%09%09%0A%09%09%0A%09%09%0A%09%09%0A%09%09%0A%09%09%0A%09%09%0A%09%09%0A%09%09%0A%09%09%0A%09%09%0A%09%09%0A%09%09%0A%09%09%0A%09%0A%09%09%0A%09%09%0A%09%09%0A%09%09%0A%09%09%0A%09%09%0A%09%09%0A%09%09%0A%09%09%0A%09%09%0A%09%09%0A%09%09%0A%09%09%0A%09%09%0A%09%0A%09%09%0A%09%09%0A%09%09%0A%09%09%0A%09%09%0A%09%09%0A%09%09%0A%09%09%0A%09%09%0A%09%09%0A%09%09%0A%09%09%0A%09%09%0A%09%09%0A%09%0A%09%09%0A%09%09%0A%09%09%0A%09%09%0A%09%09%0A%09%09%0A%09%09%0A%09%09%0A%09%09%0A%09%09%0A%09%09%0A%09%09%0A%09%09%0A%09%09%0A%09%0A%09%09%0A%09%09%0A%09%09%0A%09%09%0A%09%09%0A%09%09%0A%09%09%0A%09%09%0A%09%09%0A%09%09%0A%09%09%0A%09%09%0A%09%09%0A%09%09%0A%09%0A%09%09%0A%09%09%0A%09%09%0A%09%09%0A%09%09%0A%09%09%0A%09%09%0A%09%09%0A%09%09%0A%09%09%0A%09%09%0A%09%09%0A%09%09%0A%09%09%0A%09%0A%09%09%0A%09%09%0A%09%09%0A%09%09%0A%09%09%0A%09%09%0A%09%09%0A%09%09%0A%09%09%0A%09%09%0A%09%09%0A%09%09%0A%09%09%0A%09%09%0A%09%0A%09%09%0A%09%09%0A%09%09%0A%09%09%0A%09%09%0A%09%09%0A%09%09%0A%09%09%0A%09%09%0A%09%09%0A%09%09%0A%09%09%0A%09%09%0A%09%09%0A%09%0A%09%09%0A%09%09%0A%09%09%0A%09%09%0A%09%09%0A%09%09%0A%09%09%0A%09%09%0A%09%09%0A%09%09%0A%09%09%0A%09%09%0A%09%09%0A%09%09%0A%09%0A%09%09%0A%09%09%0A%09%09%0A%09%09%0A%09%09%0A%09%09%0A%09%09%0A%09%09%0A%09%09%0A%09%09%0A%09%09%0A%09%09%0A%09%09%0A%09%09%0A%09

And now the funny thing about it: "test" is the only thing i wrote. DOes anybody have the same problem? Any Ideas? Need more Info?

I'm running xinha rev. 757, Firefox 2.0.0.3 and 1.5.0.11 (both running on Windows XP SP2).
I cannot give you access to the project because of my company's policies concerning industrial espionage (i'm working as intern/trainee for the Fraunhofer Society - no chance!).


some snipplets:

Config:

<!-- @Jütte: Einbindung des Xinha Editor (Ersatz für problematischen TinyMCE) -->

<script type="text/javascript">
var _editor_url  = '/Authors/PageEditor/xinha/';
var _editor_lang = "de";
</script>
<script type="text/javascript" src="/Authors/PageEditor/xinha/XinhaCore.js"></script>
<script>
    var xinha_editors = [];        //enthält alle geladenen Editoren
    // Plugins - möglichere Erweiterungen: 'Equation', 'ClientsideSpellcheck'm 'SpellChecker'
    var xinha_plugins = ['CharacterMap','ContextMenu','FindReplace','ListType','UnFormat','TableOperations'];
    function xinha_init(){
        if(!Xinha.loadPlugins(xinha_plugins, xinha_init)) return;
    }
    //Xinha._addEvent(window,'load', xinha_init);
    
    xinha_init();
    
    // Setup für Plaintext (und Richtext)
    var xinha_plaintext_config = new Xinha.Config();
    xinha_plaintext_config.hideSomeButtons(' popupeditor fontname fontsize clearfonts htmlmode insertimage lefttoright righttoleft print removeformat saveas splitblock inserttable toggleborders ');
    xinha_plaintext_config.statusBar = false;
    xinha_plaintext_config.getHtmlMethod = 'DOMwalk';
    xinha_plaintext_plugins = ['CharacterMap','ContextMenu','FindReplace','ListType','UnFormat'];
    
    // Setup für Tabellen
    var xinha_table_config = new Xinha.Config();
    xinha_table_config.hideSomeButtons(' popupeditor fontname fontsize clearfonts htmlmode insertimage lefttoright righttoleft print removeformat saveas splitblock ');
    xinha_table_config.statusBar = false;
    xinha_table_config.getHtmlMethod = 'DOMwalk';
    xinha_table_plugins = ['CharacterMap','ContextMenu','FindReplace','ListType','UnFormat','TableOperations'];
    
    /** @Juette TODO: FormatBlock
    xinha_config.formatblock =
      {
    "&mdash; format &mdash;": "",
    "Heading 1": "h1",
    "Heading 2": "h2",
    "Heading 3": "h3",
    "Heading 4": "h4",
    "Heading 5": "h5",
    "Heading 6": "h6",
    "Normal"   : "p",
    "Address"  : "address",
    "Formatted": "pre"
      };
      */
    
</script>
<!-- @Jütte: Ende Xinha Editor -->

creating the editors:

// Initialisieren und Erzeugen der Editoren
    if(!xinha_editors['editor_'+comp.editor] && (comp.kind == 1 || comp.kind == 2 || comp.kind == 3)){
            
            if(comp.kind == 3){
                var editor_config = xinha_table_config;
                var plugin_names = xinha_table_plugins;
            }else{
                var editor_config = xinha_plaintext_config;
                var plugin_names = xinha_plaintext_plugins;
            }
            var editor = new Xinha('editor_'+comp.editor, Xinha.cloneObject(editor_config));
            editor.registerPlugins(plugin_names);
            xinha_editors['editor_'+comp.editor] = editor;
            xinha_editors['editor_'+comp.editor].generate();
        }
    return true;

Offline

#2 2007-04-04 03:24:56

ray
Xinha Administrator
From: Germany
Registered: 2005-03-23
Posts: 521
Website

Re: Lot's of LFs and tabs -> getHTML()

Offline

#3 2007-04-04 04:42:17

theCrank
New member
From: Germany, Karlsruhe
Registered: 2007-04-02
Posts: 2

Re: Lot's of LFs and tabs -> getHTML()

i found a new one? damnit.

maybe im able to fix it. i'll post a patch in trac then.

Offline

#4 2007-04-04 09:07:49

ray
Xinha Administrator
From: Germany
Registered: 2005-03-23
Posts: 521
Website

Re: Lot's of LFs and tabs -> getHTML()

It's fixed in changeset 807. Look at line 4140, it's using Xinha's own String.prototype.trim() function

Offline

Board footer

Powered by FluxBB