diff --git a/components/wiki/lazwiki/wiki2xhtmlconvert.pas b/components/wiki/lazwiki/wiki2xhtmlconvert.pas index bd3114f189..f9931ecbbe 100644 --- a/components/wiki/lazwiki/wiki2xhtmlconvert.pas +++ b/components/wiki/lazwiki/wiki2xhtmlconvert.pas @@ -320,7 +320,7 @@ var URL:=''; // show category without link exit; end - else if Scheme='image' then begin + else if (Scheme='image') or (Scheme='file') then begin URL:=copy(URL,p+1,length(URL)); URL:=UTF8Trim(URL); URL:=WikiTitleToPage(URL); diff --git a/components/wiki/parsewikipage.lpi b/components/wiki/parsewikipage.lpi index a1eeb719c5..20c10a75cd 100644 --- a/components/wiki/parsewikipage.lpi +++ b/components/wiki/parsewikipage.lpi @@ -1,4 +1,4 @@ - + @@ -45,17 +45,11 @@ - + - - - - - - @@ -67,12 +61,6 @@ - - - - - - diff --git a/components/wiki/wikiget.lpr b/components/wiki/wikiget.lpr index a561d653e4..5339d8a02f 100644 --- a/components/wiki/wikiget.lpr +++ b/components/wiki/wikiget.lpr @@ -30,7 +30,7 @@ uses cthreads, {$ENDIF} Classes, SysUtils, LazFileUtils, laz2_XMLRead, laz2_DOM, laz2_XMLWrite, - LazLogger, LazUTF8, CodeToolsStructs, CustApp, AVL_Tree, + LazLogger, LazUTF8, CodeToolsStructs, CustApp, AVL_Tree, strutils, {$IF FPC_FULLVERSION<20701} myfphttpclient, {$ELSE} @@ -523,7 +523,7 @@ begin if ColonPos<1 then exit; if ColonPos=length(Link) then exit; Prefix:=lowercase(copy(Link,1,ColonPos-1)); - if Prefix<>'image' then exit; + if (Prefix<>'image') and (Prefix<>'file') then exit; Link:=UTF8Trim(copy(Link,ColonPos+1,length(Link))); if Link='' then exit; Filename:=ImageToFilename(Link,true,true); @@ -539,7 +539,7 @@ begin try Client:=TFPHTTPClient.Create(nil); Response:=TMemoryStream.Create; - URL:=BaseURL+EscapeDocumentName('Image:'+WikiTitleToPage(Link)); + URL:=BaseURL+EscapeDocumentName(AnsiPropercase(Prefix, StdWordDelims)+':'+WikiTitleToPage(Link)); writeln('getting image page "',URL,'" ...'); Client.Get(URL,Response); //Client.ResponseHeaders.SaveToFile('responseheaders.txt');