#25 new
Urs Hofer

Strange <br> behaviour in Safari 5.0.2 when paragraphize is set to false

Reported by Urs Hofer | October 13th, 2010 @ 10:02 PM

Hello,
I encounter a strange problem: I set paragrahpize to false in order to only get
tags for line-breaks. I don't want paragraphs.
This works fine in firefox, but safari still sticks to a

...

tag.

I made a quick workaround in MooEditable.js inserting the shift-enter code twice, adding the following
code after line 500:


            if (Browser.Engine.webkit){
                /* Force inserting a br tag */
                var s = this.selection;
                var r = s.getRange();

                // Insert BR element
                var br = this.doc.createElement('br');
                r.insertNode(br);

                // Place caret after BR
                r.setStartAfter(br);
                r.setEndAfter(br);
                s.setRange(r);

                // Could not place caret after BR then insert an nbsp entity and move the caret
                if (s.getSelection().focusNode == br.previousSibling){
                    var nbsp = this.doc.createTextNode('\u00a0');
                    var p = br.parentNode;
                    var ns = br.nextSibling;
                    (ns) ? p.insertBefore(nbsp, ns) : p.appendChild(nbsp);
                    s.selectNode(nbsp);
                    s.collapse(1);
                }

                // Scroll to new position, scrollIntoView can't be used due to bug: http://bugs.webkit.org/show_bug.cgi?id=16117
                this.win.scrollTo(0, Element.getOffsets(s.getRange().startContainer).y);
                e.preventDefault();
            }

Comments and changes to this ticket

  • Simple Jack

    Simple Jack September 23rd, 2020 @ 05:28 PM

    You should update your Firefox to the latest version. With the latest version comes with the latest security features and updates. Make sure that all of your PC software are all updated and in the latest version. Download state of survival for PC if you are looking for a good game to play. There are a lot of free games in Google Chrome Webstore. Just pick a game and click install. https://games.lol/dungeon-keeper/

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป

A simple web-based WYSIWYG editor, written in Mootools.

People watching this ticket

Pages