Page 1 of 1

Custom formatting code

Posted: Thu Jul 14, 2011 1:50 pm
by Geoff16W
I have a question about how I can custom "join and normalize" within certain elements only.

When I hit "ctr+j" the entire text normalizes. But I would like to "join and normalize" only what is contained within each <p></p>. I can do this by hand, by selecting the individual paragraph and the hitting ctr+j. But I would rather not do this manually for each paragraph. Can you tell me how I can do this automatically for a specified element. (i.e. for the all my <p></p> elements.)

Thanks for your help :)

Re: Custom formatting code

Posted: Fri Jul 15, 2011 4:07 pm
by adrian
Hello,

You can do this automatically for all <p></p> elements by using the Find/Replace(Ctrl+F) dialog.

Text to find: \s+
Replace with: <space>
Use the actual space character: ' '

XPath: //p

Enable:
Regular expression

Press "Replace All" and all whitespaces from <p></p> elements will be normalized

Regards,
Adrian