mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-17 22:59:15 +02:00
SynEdit: SynExportHtml: don't include double quotes in the result of ColorToHTML.
git-svn-id: trunk@53342 -
This commit is contained in:
parent
46b3e668d7
commit
ba75916f60
@ -122,7 +122,7 @@ const
|
|||||||
'<head>'+LineEnding+
|
'<head>'+LineEnding+
|
||||||
'%s'+LineEnding+
|
'%s'+LineEnding+
|
||||||
'</head>'+LineEnding+
|
'</head>'+LineEnding+
|
||||||
'<body text=%s bgcolor=%s>';
|
'<body text="%s" bgcolor="%s">';
|
||||||
DocumentEnd = '</body>'+LineEnding+'</html>';
|
DocumentEnd = '</body>'+LineEnding+'</html>';
|
||||||
CodeStart = '<pre><code>';
|
CodeStart = '<pre><code>';
|
||||||
CodeEnd = '</code></pre>';
|
CodeEnd = '</code></pre>';
|
||||||
@ -281,24 +281,24 @@ begin
|
|||||||
if (Result <> '') then
|
if (Result <> '') then
|
||||||
Exit;
|
Exit;
|
||||||
RGBColor := ColorToRGB(AColor);
|
RGBColor := ColorToRGB(AColor);
|
||||||
Result := '"#000000"';
|
Result := '#000000';
|
||||||
{****************}
|
{****************}
|
||||||
RGBValue := GetRValue(RGBColor);
|
RGBValue := GetRValue(RGBColor);
|
||||||
if RGBValue > 0 then begin
|
if RGBValue > 0 then begin
|
||||||
Result[3] := Digits[RGBValue shr 4];
|
Result[2] := Digits[RGBValue shr 4];
|
||||||
Result[4] := Digits[RGBValue and 15];
|
Result[3] := Digits[RGBValue and 15];
|
||||||
end;
|
end;
|
||||||
{****************}
|
{****************}
|
||||||
RGBValue := GetGValue(RGBColor);
|
RGBValue := GetGValue(RGBColor);
|
||||||
if RGBValue > 0 then begin
|
if RGBValue > 0 then begin
|
||||||
Result[5] := Digits[RGBValue shr 4];
|
Result[4] := Digits[RGBValue shr 4];
|
||||||
Result[6] := Digits[RGBValue and 15];
|
Result[5] := Digits[RGBValue and 15];
|
||||||
end;
|
end;
|
||||||
{****************}
|
{****************}
|
||||||
RGBValue := GetBValue(RGBColor);
|
RGBValue := GetBValue(RGBColor);
|
||||||
if RGBValue > 0 then begin
|
if RGBValue > 0 then begin
|
||||||
Result[7] := Digits[RGBValue shr 4];
|
Result[6] := Digits[RGBValue shr 4];
|
||||||
Result[8] := Digits[RGBValue and 15];
|
Result[7] := Digits[RGBValue and 15];
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -343,9 +343,9 @@ procedure TSynExporterHTML.FormatAttributeInit(BackgroundChanged,
|
|||||||
begin
|
begin
|
||||||
if BackgroundChanged then
|
if BackgroundChanged then
|
||||||
AddData('<span style="background-color: ' +
|
AddData('<span style="background-color: ' +
|
||||||
AnsiDequotedStr(ColorToHtml(fLastBG), '"') {Copy(ColorToHtml(fLastBG), 2, 9)} + '>');
|
ColorToHtml(fLastBG) {Copy(ColorToHtml(fLastBG), 2, 9)} + '>');
|
||||||
if (BackgroundChanged or ForegroundChanged) and (fLastFG <> fFont.Color) then
|
if (BackgroundChanged or ForegroundChanged) and (fLastFG <> fFont.Color) then
|
||||||
AddData('<font color=' + ColorToHtml(fLastFG) + '>');
|
AddData('<font color="' + ColorToHtml(fLastFG) + '">');
|
||||||
if BackgroundChanged or ForegroundChanged or (FontStylesChanged <> []) then
|
if BackgroundChanged or ForegroundChanged or (FontStylesChanged <> []) then
|
||||||
begin
|
begin
|
||||||
if fsBold in fLastStyle then
|
if fsBold in fLastStyle then
|
||||||
@ -365,8 +365,8 @@ procedure TSynExporterHTML.FormatBeforeFirstAttribute(BackgroundChanged,
|
|||||||
begin
|
begin
|
||||||
if BackgroundChanged then
|
if BackgroundChanged then
|
||||||
AddData('<span style="background-color: ' +
|
AddData('<span style="background-color: ' +
|
||||||
AnsiDequotedStr(ColorToHtml(fLastBG), '"') {Copy(ColorToHtml(fLastBG), 2, 9)} + '>');
|
ColorToHtml(fLastBG) {Copy(ColorToHtml(fLastBG), 2, 9)} + '>');
|
||||||
AddData('<font color=' + ColorToHtml(fLastFG) + '>');
|
AddData('<font color="' + ColorToHtml(fLastFG) + '">');
|
||||||
if FontStylesChanged <> [] then begin
|
if FontStylesChanged <> [] then begin
|
||||||
if fsBold in fLastStyle then
|
if fsBold in fLastStyle then
|
||||||
AddData('<b>');
|
AddData('<b>');
|
||||||
@ -572,11 +572,11 @@ function TSynExporterHTML.MakeFontSpan(FG, BG: TColor): String;
|
|||||||
begin
|
begin
|
||||||
Result := '<span style="color: ';
|
Result := '<span style="color: ';
|
||||||
FG := ValidatedColor(FG, fFont.Color);
|
FG := ValidatedColor(FG, fFont.Color);
|
||||||
Result := Result + AnsiDequotedStr(ColorToHtml(FG), '"');
|
Result := Result + ColorToHtml(FG);
|
||||||
BG := ValidatedColor(BG, fBackgroundColor);
|
BG := ValidatedColor(BG, fBackgroundColor);
|
||||||
if UseBackGround then
|
if UseBackGround then
|
||||||
begin
|
begin
|
||||||
Result := Result + '; background-color: ' + AnsiDequotedStr(ColorToHtml(BG), '"');
|
Result := Result + '; background-color: ' + ColorToHtml(BG);
|
||||||
end;
|
end;
|
||||||
Result := Result + ';">';
|
Result := Result + ';">';
|
||||||
end;
|
end;
|
||||||
|
Loading…
Reference in New Issue
Block a user