Article View: adobe.scripting.indesign
Article #9292[JS][CS2] What character can I use for forced line break
From: Erik_Bruinsma
Date: Fri, 25 Aug 2006 11:31
Date: Fri, 25 Aug 2006 11:31
25 lines
1685 bytes
1685 bytes
Hi,
What character can I use if I want a forced line break in the string that I paste in a text.contents.
If I insert a forced line break in InDesign (Shift + Enter), and then select, copy and paste that part into a Unicode editor(Unipad) it gives the forced line break character as unicode character u2028.
But when I try to use it in the string, InDesign shows the character not found glyph highlighted in pink.
I use the same sollution for other special characters, and for those it works just fine.
here is the function I to use to replace the tags I get in the content for utf8 characters.
function tagToUTF8( pi_text)
{
var text = pi_text;
text = text.replace(/<\\h>/gi, "\u00AD"); //soft hyphen
text = text.replace(/<\\d>/gi, "\u2028"); //forced line break
text = text.replace(/<\\t>/gi, "\u0009"); //tab
text = text.replace(/<\\s>/gi, "\u0020"); //space
text = text.replace(/<\\!s>/gi, "\u00A0"); //non breaking space
text = text.replace(/<\\->/gi, "\u002D"); //hyphen
text = text.replace(/<\\!->/gi, "\u2011"); //non breaking hyphen
return text;
}
Thanx Erik
Technical Details
Message-ID:
<3bc164de.-1@webcrossing.la2eafNXanI>Path:
arc1-ca.pugleaf.net!g2news2.google.com!news3.google.com!news4.google.com!news.glorb.com!news.ecp.fr!news.stben.net!webcrossingShow Full Headers
Complete Article Headers
X-Google-Thread: f939a,526eb790cd854917,start X-Google-Attributes: gidf939a,public X-Google-Language: ENGLISH,ASCII-7-bit From: Erik_Bruinsma@adobeforums.com Newsgroups: adobe.scripting.indesign Subject: [JS][CS2] What character can I use for forced line break Message-ID: <3bc164de.-1@webcrossing.la2eafNXanI> Date: Fri, 25 Aug 2006 04:31:45 -0700 Lines: 31 MIME-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 8bit Path: arc1-ca.pugleaf.net!g2news2.google.com!news3.google.com!news4.google.com!news.glorb.com!news.ecp.fr!news.stben.net!webcrossing