Jean-Marc Lasgouttes wrote:
[EMAIL PROTECTED] writes:

On Mon, 7 Apr 2008, Angus Leeming wrote:

While I'm at it ;-)
Hi Angus,

Would it be to much to ask you to just fix it?

I am not sure his employer would allow him to %-]

:-P

I see many other pages are afflicted by the -- and '...' nastiness. The sed script below seems to do the trick on http://www.lyx.org/test/WhatIsLyX.

The pages look much brighter now! What's with the funny slanty lines at the top though?

Regards,
Angus

# Replace all occurrences of -- with —
# Ignore HTML comment delimiters <!-- and -->
[EMAIL PROTECTED]([^!]\)--\([^>]\)@\1\&mdash;[EMAIL PROTECTED]

# If the line does not start <p class='vspace'>, break.
/<p class='vspace'>/!b

# Temporarily append a \n after all '...' pairs.
s@'[^']\{1,\}'@&\
@g

# Replace all "..." with &ldquo;...&rdquo;
s@"\([^"]\{1,\}\)"@\&ldquo;\1\&rdquo;@g

# Replace all '...' with &ldquo;...&rdquo;
# The loop fixes up the rightmost '...' on each iteration
# until there's only the <p class='vspace'> on the first line left.
:loop
[EMAIL PROTECTED](\n.*\) '\([^']\{1,\}\)'@\1 \&ldquo;\2\&rdquo;@
tloop

# Remove all those \n placeholders.
[EMAIL PROTECTED]@@g

# The end.

Reply via email to