Where did you install Firefox from? Help Mozilla uncover 3rd party websites that offer problematic Firefox installation by taking part in our campaign. There will be swag, and you'll be featured in our blog if you manage to report at least 10 valid reports!

ძიება მხარდაჭერაში

ნუ გაებმებით თაღლითების მახეში მხარდაჭერის საიტზე. აქ არასდროს მოგთხოვენ სატელეფონო ნომერზე დარეკვას, შეტყობინების გამოგზავნას ან პირადი მონაცემების გაზიარებას. გთხოვთ, გვაცნობოთ რამე საეჭვოს შემჩნევისას „დარღვევაზე მოხსენების“ მეშვეობით.

Learn More

Disable insertion of <br> automatically

  • 8 პასუხი
  • 0 მომხმარებელი წააწყდა მსგავს სიძნელეს
  • 1 ნახვა
  • ბოლოს გამოეხმაურა tomfinn7781

Dear all, I would like to know how to disable the automatic insertion of the tag <br> in a text editor in Firefox. I am using Froala, and I am experiencing this only in firefox. Chrome and Edge do not add this tag automatically. Thank you for you support. Kind regards, Cristiano

Dear all, I would like to know how to disable the automatic insertion of the tag &lt;br&gt; in a text editor in Firefox. I am using Froala, and I am experiencing this only in firefox. Chrome and Edge do not add this tag automatically. Thank you for you support. Kind regards, Cristiano

ჩასწორების თარიღი: , ავტორი: cor-el

ყველა პასუხი (8)

I tested on https://froala.com/wysiwyg-editor/inline/

In both browsers, not surprisingly, a <br> tag is inserted when I press the Enter key. They also both seem to leave the same content when I delete all of the text: <p><br></p>. So I don't see the difference yet.

Are you getting the tag with simple typing, cut and paste, or other actions?

გამოსადეგია?

I am getting <br> by simple typing space keyboard. I noticed this behavior only on Firefox, so I wonder if this is something done in the browser or it is a specific implementation in Froala for this browser. Could you help me?

ჩასწორების თარიღი: , ავტორი: cor-el

გამოსადეგია?

Okay, I remember now. When an element is contenteditable and has no actual content, browsers need to insert something to give the element dimension (otherwise, it's a flat line). Firefox inserts a <br> and some other browsers may insert a non-breaking space (&nbsp;).

There is an old bug on file about possibly cleaning up the <br> when it's no longer needed, or switching to the method used by more browsers, but it doesn't have a high enough priority to get addressed, unfortunately. I'll add a reference to this thread so they know it is still an issue in the wild. (#1615852)

Meanwhile, if you are implementing this editor on your site, is the problem that the <br> gets submitted erroneously to a script? Or that it causes unexpected formatting for users entering text?

გამოსადეგია?

Hi, thank you for your support. Unfortunately this situation is happening even if the element that is contenteditable has actual content.

the problem we are facing is that the break line tag is interpreted as a new paragraph. Then, the content starts to have unexpected new lines. I will see what we can do in our side. But if there was a configuration on Firefox where we could avoid the insertion of this tag, or inserting something else that would not harm the content of the element, that would be great.

Thank you again for your support.

გამოსადეგია?

Hello @jscher2000, is there any other advice you could give over the issue? Thank you.

გამოსადეგია?

Switch dom.document.edit_command.insertBrOnReturn.enabled = false ?

გამოსადეგია?

Hi @TyDraniu, Firefox still adds the tag
after disabling the property you mentioned.

გამოსადეგია?

Hi @TyDraniu,

Even after disabling the property you stated, Firefox continues to append the tag.

გამოსადეგია?

დასვით კითხვა

უნდა შეხვიდეთ ანგარიშზე პასუხის დასაწერად. გთხოვთ, დასვათ ახალი შეკითხვა, თუ ჯერ არ გაქვთ ანგარიში.