THtmlViewer component
function FindDisplayPos(SourcePos: integer; Prev: boolean): integer;
Given a character position in the HTML source, FindDisplayPos finds the nearest equivalent character position in the displayed document.
If there is no exact equivalent character position, setting Prev True will find the nearest previous character position. Otherwise the next position will be returned.