QUELLTEXT
{
delete_html_tags.pas
Dieses Plugin löscht alle HTML-Tags innerhalb des geöffneten
Proton-Dokuments bzw. innerhalb des markierten Textes.
Beispielplugin
Proton Plugins mit dem Free Pascal Compiler erstellen.
Zum kompilieren folgenden Befehl aufrufen:
c:ppbinwin32ppc386 -Sd delete_html_tags.pas
Hinweis:
Um Proton als Free-Pascal IDE zu nutzen, einfach
folgenden Shortcut in den Programmeinstellungen
definieren:
command.com /k c:ppbinwin32ppc386 -Sd %A%
}
library delete_html_tags;
uses
regexpr;
const KEINE_RUECKGABE=0;
RUECKGABE_ERSETZT_MARKIERUNG = 1;
RUECKGABE_ERSETZT_EDITORTEXT = 2;
var RUECKGABETYP:integer;
function pluginStart(text:pchar; selstart,sellength:integer) : pchar; export;stdcall;
var
r : tregexprengine;
i,len : longint;
s:string;
begin
r:=GenerateRegExprEngine('<[^>]+>',[]);
SetString(s,text,strlen(text));
if (sellength=0) then
RUECKGABETYP:=RUECKGABE_ERSETZT_EDITORTEXT
else
begin
s:=copy(s,selstart+1,sellength);
RUECKGABETYP:=RUECKGABE_ERSETZT_MARKIERUNG;
end;
while RegExprPos(r,pchar(s),i,len) do
begin
delete(s,i+1,len);
end;
DestroyregExprEngine(r);
pluginStart := pchar(s);
end;
function pluginRueckgabetyp:Integer;export;stdcall;
begin
pluginRueckgabetyp :=RUECKGABETYP;
end;
function pluginInterfaceVersion: integer; export;stdcall;
begin
pluginInterfaceVersion := 1;
end;
exports
pluginRueckgabetyp,
pluginStart,
pluginInterfaceVersion;
end.
delete_html_tags.pas
Dieses Plugin löscht alle HTML-Tags innerhalb des geöffneten
Proton-Dokuments bzw. innerhalb des markierten Textes.
Beispielplugin
Proton Plugins mit dem Free Pascal Compiler erstellen.
Zum kompilieren folgenden Befehl aufrufen:
c:ppbinwin32ppc386 -Sd delete_html_tags.pas
Hinweis:
Um Proton als Free-Pascal IDE zu nutzen, einfach
folgenden Shortcut in den Programmeinstellungen
definieren:
command.com /k c:ppbinwin32ppc386 -Sd %A%
}
library delete_html_tags;
uses
regexpr;
const KEINE_RUECKGABE=0;
RUECKGABE_ERSETZT_MARKIERUNG = 1;
RUECKGABE_ERSETZT_EDITORTEXT = 2;
var RUECKGABETYP:integer;
function pluginStart(text:pchar; selstart,sellength:integer) : pchar; export;stdcall;
var
r : tregexprengine;
i,len : longint;
s:string;
begin
r:=GenerateRegExprEngine('<[^>]+>',[]);
SetString(s,text,strlen(text));
if (sellength=0) then
RUECKGABETYP:=RUECKGABE_ERSETZT_EDITORTEXT
else
begin
s:=copy(s,selstart+1,sellength);
RUECKGABETYP:=RUECKGABE_ERSETZT_MARKIERUNG;
end;
while RegExprPos(r,pchar(s),i,len) do
begin
delete(s,i+1,len);
end;
DestroyregExprEngine(r);
pluginStart := pchar(s);
end;
function pluginRueckgabetyp:Integer;export;stdcall;
begin
pluginRueckgabetyp :=RUECKGABETYP;
end;
function pluginInterfaceVersion: integer; export;stdcall;
begin
pluginInterfaceVersion := 1;
end;
exports
pluginRueckgabetyp,
pluginStart,
pluginInterfaceVersion;
end.