' +
+ sLineBreak;
var
StyleName: string;
+ StyleValue: string;
+ ColorAttrs: string;
begin
- StyleName := GetStyleName(Highlighter, Highlighter.GetTokenAttribute);
- AddData(Format('
', [StyleName]));
+ if UseBackground then
+ ColorAttrs := Format(ColorAttrFmt, [ColorToHTML(Color), ColorToHTML(Font.Color)])
+ else
+ ColorAttrs := '';
+ AddData(Format(FirstDiv, [FFont.Name, FFont.Size.ToString, ColorAttrs]));
+ AddData('');
+ if FCreateHTMLFragment or FInlineCSS then
+ begin
+ // Cache all our CSS values.
+ FStyleValueCache.Clear;
+ EnumHighlighterAttris(Highlighter, True, AttriToInlineCSSCallback, []);
+ FStyleValueCache.TryGetValue(Highlighter.GetTokenAttribute, StyleValue);
+ if StyleValue <> '' then
+ AddData('')
+ else
+ AddData('');
+ end
+ else
+ begin
+ StyleName := GetStyleName(Highlighter, Highlighter.GetTokenAttribute);
+ AddData('');
+ end;
end;
procedure TSynExporterHTML.FormatNewLine;
begin
- AddNewLine;
+ if FAddNewLine then
+ begin
+ AddData(SLineBreak);
+ FAddNewLine := False;
+ end;
+ FAddNewLine := True;
end;
-function TSynExporterHTML.GetFooter: UnicodeString;
+function TSynExporterHTML.GetFooter: string;
begin
Result := '';
- if fExportAsText then
- Result := ''#13#10'
'#13#10
- else
- Result := '';
- if not(FCreateHTMLFragment and fExportAsText) then
- Result := Result + '