From 98332acbbc36f36f5583c22ff16b648966ca7646 Mon Sep 17 00:00:00 2001 From: wp_xxyyzz Date: Fri, 31 May 2019 14:42:26 +0000 Subject: [PATCH] jvcllaz: Replace LineEndings in THMLParser demo by "paragraph mark" character. git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@6985 8e941d3f-bd1b-0410-a28a-d453659cc2b4 --- .../JvHTMLParser/JvHTMLParserMainFormU.pas | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/components/jvcllaz/examples/JvHTMLParser/JvHTMLParserMainFormU.pas b/components/jvcllaz/examples/JvHTMLParser/JvHTMLParserMainFormU.pas index a102dd4de..8cf3cad61 100644 --- a/components/jvcllaz/examples/JvHTMLParser/JvHTMLParserMainFormU.pas +++ b/components/jvcllaz/examples/JvHTMLParser/JvHTMLParserMainFormU.pas @@ -193,15 +193,20 @@ begin end; end; +const + PARAGRAPH_MARK = #$E2#$81#$8B; + procedure TJvHTMLParserMainForm.TableKeyFound(Sender: TObject; Key, Results, OriginalLine: string); begin Self.Tag := Self.Tag + 1; - DisplayMemo1.Lines.Add(Key + #13#10 + Results); + DisplayMemo1.Lines.Add(Key + LineEnding + Results); if UpperCase(Key) = 'TR' then CurNode := TreeView1.Items.AddChild(nil, 'TR') - else + else begin + Results := StringReplace(Results, LineEnding, PARAGRAPH_MARK, [rfReplaceAll]); TreeView1.Items.AddChild(CurNode, Results); + end; end; procedure TJvHTMLParserMainForm.TableKeyFoundEx(Sender: TObject; @@ -211,13 +216,15 @@ var i : integer; begin Self.Tag := Self.Tag + 1; - DisplayMemo1.Lines.Add(Key + #13#10 + Results); + DisplayMemo1.Lines.Add(Key + LineEnding + Results); for i:=0 to Attributes.Count-1 do DisplayMemo1.Lines.Add('Attributes=' + Attributes[i]); if UpperCase(Key) = 'TR' then CurNode := TreeView1.Items.AddChild(nil, 'TR') - else + else begin + Results := StringReplace(Results, LineEnding, PARAGRAPH_MARK, [rfReplaceAll]); TreeView1.Items.AddChild(CurNode, Results); + end; end; procedure TJvHTMLParserMainForm.HTML2TextKeyFound(Sender: TObject; Key, Results,