Extra <br> in html
Posted: Tue Mar 07, 2006 10:38 am
Hi Sergey,
In a TRichViewEdit I type in one word, followed by 2 carriage returns and then another word, so it looks like this:
When I save it to Html it writes code like this:
<p class=X><span class=X>Hello</span></p>
<p class=X><span class=X><br></span> </p>
<p class=X><span class=X>Sergey</span></p>
Which produces Html that renders an extra blank line like this:
I have just moved to v1.9.23 from v1.8 so I am noticing some differences here and maybe I am doing something wrong. But in CRVData.pas, in the function TCustomRVData.GetTextForHTML, the block of code at the top is adding the <br> tag when it shouldn't.
if (Result='') and IsFromNewLine(ItemNo) and
((ItemNo+1=ItemCount) or IsParaStart(ItemNo+1)) then begin
Result := Format('<br%s>', [RV_HTMLGetEndingSlash(SaveOptions)]);
I have commented out the line above in bold. Now when I save to html the html looks correct, but is this wrong to comment out this line?
In a TRichViewEdit I type in one word, followed by 2 carriage returns and then another word, so it looks like this:
Code: Select all
Hello
Sergey
<p class=X><span class=X>Hello</span></p>
<p class=X><span class=X><br></span> </p>
<p class=X><span class=X>Sergey</span></p>
Which produces Html that renders an extra blank line like this:
Code: Select all
Hello
Sergey
if (Result='') and IsFromNewLine(ItemNo) and
((ItemNo+1=ItemCount) or IsParaStart(ItemNo+1)) then begin
Result := Format('<br%s>', [RV_HTMLGetEndingSlash(SaveOptions)]);
I have commented out the line above in bold. Now when I save to html the html looks correct, but is this wrong to comment out this line?