mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-18 07:19:22 +02:00
wiki: <em>, tags in table cell
git-svn-id: trunk@35617 -
This commit is contained in:
parent
61a12a5cc6
commit
a8098f0d48
@ -133,7 +133,7 @@ var
|
|||||||
Filename: String;
|
Filename: String;
|
||||||
begin
|
begin
|
||||||
Filename:=PageToFilename(Page,true);
|
Filename:=PageToFilename(Page,true);
|
||||||
DebugLn(['TWiki2HTMLConverter.SavePage ',Filename]);
|
//DebugLn(['TWiki2HTMLConverter.SavePage ',Filename]);
|
||||||
ms:=TMemoryStream.Create;
|
ms:=TMemoryStream.Create;
|
||||||
try
|
try
|
||||||
SavePageToStream(Page,ms);
|
SavePageToStream(Page,ms);
|
||||||
|
@ -348,7 +348,7 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
wptP, wptBold, wptItalic, wptStrikeTagShort, wptUnderlineTag, wptTT,
|
wptP, wptBold, wptItalic, wptStrikeTagShort, wptUnderlineTag, wptTT,
|
||||||
wptSup, wptSub, wptSmall, wptSpan, wptString, wptVar, wptKey,
|
wptSup, wptSub, wptSmall, wptEm, wptSpan, wptString, wptVar, wptKey,
|
||||||
wptPre, wptCenter,
|
wptPre, wptCenter,
|
||||||
wptBulletList, wptNumberedList, wptDefinitionList,
|
wptBulletList, wptNumberedList, wptDefinitionList,
|
||||||
wptTable, wptTableRow, wptTableCell, wptTableHeadCell,
|
wptTable, wptTableRow, wptTableCell, wptTableHeadCell,
|
||||||
|
@ -53,6 +53,7 @@ type
|
|||||||
wptSup, // <sup>
|
wptSup, // <sup>
|
||||||
wptSub, // <sub>
|
wptSub, // <sub>
|
||||||
wptSmall, // <small>
|
wptSmall, // <small>
|
||||||
|
wptEm, // <em>
|
||||||
wptString, // <string>
|
wptString, // <string>
|
||||||
wptVar, // <var>
|
wptVar, // <var>
|
||||||
wptKey, // <key>
|
wptKey, // <key>
|
||||||
@ -139,6 +140,7 @@ const
|
|||||||
(Caption: 'Sup'; Flags: []; Group: wpgFont; BaseToken: wptSup), // wptSup,
|
(Caption: 'Sup'; Flags: []; Group: wpgFont; BaseToken: wptSup), // wptSup,
|
||||||
(Caption: 'Sub'; Flags: []; Group: wpgFont; BaseToken: wptSub), // wptSub,
|
(Caption: 'Sub'; Flags: []; Group: wpgFont; BaseToken: wptSub), // wptSub,
|
||||||
(Caption: 'Small'; Flags: []; Group: wpgFont; BaseToken: wptSmall), // wptSmall,
|
(Caption: 'Small'; Flags: []; Group: wpgFont; BaseToken: wptSmall), // wptSmall,
|
||||||
|
(Caption: 'Em'; Flags: []; Group: wpgFont; BaseToken: wptEm), // wptEm,
|
||||||
(Caption: 'String'; Flags: []; Group: wpgFont; BaseToken: wptString), // wptString,
|
(Caption: 'String'; Flags: []; Group: wpgFont; BaseToken: wptString), // wptString,
|
||||||
(Caption: 'Var'; Flags: []; Group: wpgFont; BaseToken: wptVar), // wptVar,
|
(Caption: 'Var'; Flags: []; Group: wpgFont; BaseToken: wptVar), // wptVar,
|
||||||
(Caption: 'Key'; Flags: []; Group: wpgFont; BaseToken: wptKey), // wptKey,
|
(Caption: 'Key'; Flags: []; Group: wpgFont; BaseToken: wptKey), // wptKey,
|
||||||
@ -276,6 +278,7 @@ type
|
|||||||
procedure EmitTextToken;
|
procedure EmitTextToken;
|
||||||
procedure ParseCell;
|
procedure ParseCell;
|
||||||
procedure ParseAttributes(StartPos, EndPos: PChar);
|
procedure ParseAttributes(StartPos, EndPos: PChar);
|
||||||
|
procedure ParseNoWiki;
|
||||||
procedure CloseTableCell;
|
procedure CloseTableCell;
|
||||||
procedure CloseRangeToken(Typ: TWPTokenType);
|
procedure CloseRangeToken(Typ: TWPTokenType);
|
||||||
procedure OpenRangeToken(Typ: TWPTokenType);
|
procedure OpenRangeToken(Typ: TWPTokenType);
|
||||||
@ -587,6 +590,27 @@ begin
|
|||||||
//debugln(['TWikiPage.ParseAttributes stopped at <',dbgstr(StartPos,p-StartPos),'>']);
|
//debugln(['TWikiPage.ParseAttributes stopped at <',dbgstr(StartPos,p-StartPos),'>']);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TWikiPage.ParseNoWiki;
|
||||||
|
begin
|
||||||
|
// ignore all tags
|
||||||
|
// this is not the same as pre (preformatted treats spaces and line breaks)
|
||||||
|
EmitTextToken;
|
||||||
|
FCurP:=FindTagEnd(FCurP);
|
||||||
|
FLastEmitPos:=FCurP;
|
||||||
|
repeat
|
||||||
|
case FCurP^ of
|
||||||
|
#0: break;
|
||||||
|
'<':
|
||||||
|
if TokenIs('</nowiki>') then
|
||||||
|
break;
|
||||||
|
end;
|
||||||
|
inc(FCurP);
|
||||||
|
until false;
|
||||||
|
EmitTextToken;
|
||||||
|
FCurP:=FindTagEnd(FCurP);
|
||||||
|
FLastEmitPos:=FCurP;
|
||||||
|
end;
|
||||||
|
|
||||||
procedure TWikiPage.CloseTableCell;
|
procedure TWikiPage.CloseTableCell;
|
||||||
var
|
var
|
||||||
t: TWPTokenType;
|
t: TWPTokenType;
|
||||||
@ -993,6 +1017,9 @@ begin
|
|||||||
if NextBar^='[' then begin
|
if NextBar^='[' then begin
|
||||||
// a link
|
// a link
|
||||||
break;
|
break;
|
||||||
|
end else if (NextBar^='<') and IsIdentStartChar[NextBar[1]] then begin
|
||||||
|
// a tag
|
||||||
|
break;
|
||||||
end;
|
end;
|
||||||
inc(NextBar);
|
inc(NextBar);
|
||||||
end;
|
end;
|
||||||
@ -1051,6 +1078,7 @@ begin
|
|||||||
else if CompareIdentifiers(NameP,'sup')=0 then EmitTag(wptSup,Range)
|
else if CompareIdentifiers(NameP,'sup')=0 then EmitTag(wptSup,Range)
|
||||||
else if CompareIdentifiers(NameP,'sub')=0 then EmitTag(wptSub,Range)
|
else if CompareIdentifiers(NameP,'sub')=0 then EmitTag(wptSub,Range)
|
||||||
else if CompareIdentifiers(NameP,'small')=0 then EmitTag(wptSmall,Range)
|
else if CompareIdentifiers(NameP,'small')=0 then EmitTag(wptSmall,Range)
|
||||||
|
else if CompareIdentifiers(NameP,'em')=0 then EmitTag(wptEm,Range)
|
||||||
else if CompareIdentifiers(NameP,'string')=0 then EmitTag(wptString, Range)
|
else if CompareIdentifiers(NameP,'string')=0 then EmitTag(wptString, Range)
|
||||||
else if CompareIdentifiers(NameP,'var')=0 then EmitTag(wptVar,Range)
|
else if CompareIdentifiers(NameP,'var')=0 then EmitTag(wptVar,Range)
|
||||||
else if CompareIdentifiers(NameP,'key')=0 then EmitTag(wptKey,Range)
|
else if CompareIdentifiers(NameP,'key')=0 then EmitTag(wptKey,Range)
|
||||||
@ -1079,23 +1107,7 @@ begin
|
|||||||
//debugln(['TWikiPage.Parse ',dbgs(Pointer(FCurP)),' ',FCurP^,' ',FindTagEnd(FCurP)-FCurP]);
|
//debugln(['TWikiPage.Parse ',dbgs(Pointer(FCurP)),' ',FCurP^,' ',FindTagEnd(FCurP)-FCurP]);
|
||||||
HandleCode;
|
HandleCode;
|
||||||
end else if TokenIs('<nowiki>') then begin
|
end else if TokenIs('<nowiki>') then begin
|
||||||
// ignore all tags
|
ParseNoWiki;
|
||||||
// this is not the same as pre (preformatted treats spaces and line breaks)
|
|
||||||
EmitTextToken;
|
|
||||||
FCurP:=FindTagEnd(FCurP);
|
|
||||||
FLastEmitPos:=FCurP;
|
|
||||||
repeat
|
|
||||||
case FCurP^ of
|
|
||||||
#0: break;
|
|
||||||
'<':
|
|
||||||
if TokenIs('</nowiki>') then
|
|
||||||
break;
|
|
||||||
end;
|
|
||||||
inc(FCurP);
|
|
||||||
until false;
|
|
||||||
EmitTextToken;
|
|
||||||
FCurP:=FindTagEnd(FCurP);
|
|
||||||
FLastEmitPos:=FCurP;
|
|
||||||
end else begin
|
end else begin
|
||||||
UnknownTag;
|
UnknownTag;
|
||||||
end;
|
end;
|
||||||
|
@ -299,7 +299,7 @@ begin
|
|||||||
writeln(' --format=[fpdoc|html|xhtml|chm]');
|
writeln(' --format=[fpdoc|html|xhtml|chm]');
|
||||||
writeln(' --outputdir=<output directory> : directory for all files. default: ',Converter.OutputDir);
|
writeln(' --outputdir=<output directory> : directory for all files. default: ',Converter.OutputDir);
|
||||||
writeln(' --imagesdir=<images directory> : directory of image files. default: ',Converter.ImagesDir);
|
writeln(' --imagesdir=<images directory> : directory of image files. default: ',Converter.ImagesDir);
|
||||||
writeln(' --title=<string> : the title of the wiki. default: ',Converter.ImagesDir);
|
writeln(' --title=<string> : the title of the wiki. default: "',Converter.Title,'"');
|
||||||
writeln(' --nowarnurl=<string> : do not warn for URLs starting with this. Can be given multiple times.');
|
writeln(' --nowarnurl=<string> : do not warn for URLs starting with this. Can be given multiple times.');
|
||||||
writeln(' <inputfile> : wiki page in xml format, can be given multiple times');
|
writeln(' <inputfile> : wiki page in xml format, can be given multiple times');
|
||||||
writeln(' Duplicates are ignored.');
|
writeln(' Duplicates are ignored.');
|
||||||
|
@ -363,6 +363,8 @@ begin
|
|||||||
// a change
|
// a change
|
||||||
Page:=LeftStr(href,Pos('&',href)-1);
|
Page:=LeftStr(href,Pos('&',href)-1);
|
||||||
//writeln('TWikiGet.GetRecent page="'+Page+'"');
|
//writeln('TWikiGet.GetRecent page="'+Page+'"');
|
||||||
|
if not (FAllPages.Contains(Page)) then
|
||||||
|
continue; // deleted in the mean time
|
||||||
if CheckedPages.Contains(Page) then continue;
|
if CheckedPages.Contains(Page) then continue;
|
||||||
if IsIgnoredPage(Page) then continue;
|
if IsIgnoredPage(Page) then continue;
|
||||||
if FNeededPages.Contains(Page) then continue;
|
if FNeededPages.Contains(Page) then continue;
|
||||||
@ -749,6 +751,7 @@ begin
|
|||||||
writeln('--allmissing : download all wiki pages, if file not already there.');
|
writeln('--allmissing : download all wiki pages, if file not already there.');
|
||||||
writeln('--recent=<days> : download pages again if changed in the last days on the site.');
|
writeln('--recent=<days> : download pages again if changed in the last days on the site.');
|
||||||
writeln(' includes --allmissing.');
|
writeln(' includes --allmissing.');
|
||||||
|
writeln(' ToDo: check more than last 500 changes.');
|
||||||
writeln('--ignore-recent=<minutes> : do not download again files younger than this on disk.');
|
writeln('--ignore-recent=<minutes> : do not download again files younger than this on disk.');
|
||||||
writeln(' combine with --recent. Default: ',IgnoreFilesYoungerThanMin);
|
writeln(' combine with --recent. Default: ',IgnoreFilesYoungerThanMin);
|
||||||
writeln('--shownotusedpages : show not used files in the output directory.');
|
writeln('--shownotusedpages : show not used files in the output directory.');
|
||||||
@ -762,7 +765,7 @@ begin
|
|||||||
writeln('Example: download the whole wiki');
|
writeln('Example: download the whole wiki');
|
||||||
writeln(' ',ExeName,' --allmissing');
|
writeln(' ',ExeName,' --allmissing');
|
||||||
writeln('Example: call this to download new files once per week');
|
writeln('Example: call this to download new files once per week');
|
||||||
writeln(' ',ExeName,' --recent=8');
|
writeln(' ',ExeName,' --recent=8 --deletenotusedpages --deletenotusedimages');
|
||||||
end;
|
end;
|
||||||
|
|
||||||
var
|
var
|
||||||
|
Loading…
Reference in New Issue
Block a user