0

In my dtd file for my localization strings for the xul of my addon, I have a very long string in which I need a carriage return.

<!ENTITY myentity.label "THIS IS A TEST OF THE EMERGENCY BROADCAST SYSTEM. **break** REPEAT: THIS IS ONLY A TEST.">

What can I put in please of break in my example? My dtd file is encoded as UTF-8 without BOM.

I've tried (in place of the break): \u000D \u000D\u000A &#xa; %0D%0A

And I've tried adding a literal carriage return, too.

<!ENTITY myentity.label "THIS IS A TEST OF THE EMERGENCY BROADCAST SYSTEM.
REPEAT: THIS IS ONLY A TEST.">

but when the string shows in the dialogue window in Firefox, it still shows as one long line with no breaks - which means the text runs off the edge of the dialogue box.

It seems like I should use the unicode code for the character, but when I add that, it just prints literally.

Community
  • 1
  • 1
bgmCoder
  • 6,205
  • 8
  • 58
  • 105

1 Answers1

1

You cannot put a carriage return in an entity directly.

If the entity is the text content of a <description>, you can add xmlns:html="http://www.w3.org/1999/xhtml to your window or overlay definition and then use <html:br/> in your entity.

The preferred way to do what you are trying to do is to set a max width on the XUL description entry via CSS and allow it to wrap. For this to work, the text must be a child of the description (not the value attribute).

See:

https://developer.mozilla.org/en-US/docs/XUL/description

Mike Kaply
  • 747
  • 3
  • 12
  • Thank you very much! That is what I was looking for - the way to add the html into the entity; however, I did, finally did set the width property on the description tag. – bgmCoder Nov 29 '12 at 16:19