View Single Post
  #5  
Old September 29th, 2015, 02:55 PM
step's Avatar
step step is offline
Senior Contributor
 
Join Date: Jan 2010
Location: Charlotte, NC
Posts: 955
Default Re: Nobreak function and Ampersand problem

I wonder if the conversion is happening elsewhere in your DSF – prior to the data being processed by the TaggedDataField function. If that were the case, the first ampersand in "&" would be converted to the same entity and give the appearance that it wasn't being properly converted to raw text. With that in mind, you could try to account for that:
Code:
function NoBreak(s)
{
  return s.replace(/&/g,'&').replace(/ /g, " ");
}
return NoBreak(TaggedDataField("title"));
Or maybe:
Code:
function NoBreak(s)
{
  return RawTextFromTagged(s).replace(/&/g,'&').replace(/ /g, " ");
}
return NoBreak(TaggedDataField("title"));
__________________
Ste Pennell
FusionPro VDP Creator 9.3.15
Adobe Acrobat X 10.1.1
Mac OS X 10.12

LinkedIn
Reply With Quote