1

Topic: Outlook conditional comments corrupted

Hi,

Running htmlAwed 1.2.2, I'm having trouble with it corrupting outlook conditional comments (http://labs.actionrocket.co/microsoft-outlook-conditional-statements) by adding white space, even though I have comments = 3 set in config.

Sequences like

<![endif]-->

are converted to

<![endif] -->

, and

<!--[if !mso]><!-->

to

<!--[if !mso]><! -->

.

These small changes are enough to break them. I'm working around it by replacing the broken patterns after filtering, but it would be better if it didn't happen in the first place. Is there some way of keeping these absolutely intact if comments = 3?

(and yes, these are a disgusting outlookism!)

2

Re: Outlook conditional comments corrupted

> keeping these absolutely intact if comments = 3?

Unfortunately, no... the 'comments' parameter affects how htmLawed handles content of comments; htmLawed will still add the extra space in the comment markers.

I will release a new version with a new option value of '4' for 'comments' so that htmLawed leaves comment markers untouched. This may take a few days but the modification is simple:

 // in function hl_cmtcd, find

if($n == 'comment'){
 if(substr(($t = preg_replace('`--+`', '-', substr($t, 4, -3))), -1) != ' '){$t .= ' ';}
}

// and modify the top line to
if($n == 'comment' && $v < 4){

3

Re: Outlook conditional comments corrupted

Thanks, that's great.

4

Re: Outlook conditional comments corrupted

Version 1.2.3 with new option value of 4 for 'comments' has now been released.