I'm still not getting anywhere. Following is my attempt to do as you suggest...
procedure ParseReview(HTML : String);
var
curPos, endPos : Integer;
TmpStr, TmpStr1, TmpStr2 : String;
begin
curPos := Pos('<div id="results-table">', HTML);
endPos := curPos
if curPos < 1 then
Exit;
//Review
curPos := PosFrom('<td colspan="2">', HTML, curPos);
endPos := PosFrom('</p></td>', HTML, curPos);
TmpStr := Copy(HTML, curPos, EndPos - curPos);
TmpStr1 := StringReplace(TmpStr, ' -- ', '—', True, True, False);
TmpStr2 := StringReplace(TmpStr1, ' --- ', '—', True, True, False);
TmpStr := StringReplace(TmpStr2, '--', '—', True, True, False);
TmpStr1 := StringReplace(TmpStr, '<br />', #13#10, True, True, False);
TmpStr2 := RemoveTags(TmpStr1, True);
AddCustomFieldValueByName('Review', TmpStr2);
end;
The TmpStr1 := StringReplace(TmpStr, '<br />', #13#10, True, True, False); line does nothing. It seems the Copy function removes the <br /> tags, so there's nothing to replace. And even if there were something to replace, the #13#10 doesn't seem to be recognized by the function.
The result of the Copy function is a set of four CRLF between paragraphs. This, of course, results in three blank lines instead of one, as desired.