Autor Beitrag
Pr0g
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 220


D7 Pers
BeitragVerfasst: Sa 03.06.06 16:25 
Hallo,

ich habe für ein (PHP-)Projekt von mir eine Prüffunktion für BBCodes geschrieben, welcher später im Script ein Text übergeben wird, damit dieser vor dem Speichern korrigiert wird. Die Funktion behebt also Fehler im BBCode (falsche Verschachtelung, fehlende Tags etc.), damit die Seite später gültig bleibt und keine Fehler entstehen können.

Ich würde mich freuen wenn ihr die Funktion nochmal testen könntet, vielleicht findet ihr ja noch Fehler, die ich übersehen haben, oder habt noch Vorschläge für weitere Verändungen, die von der Funktion durchgeführt werden sollten.

Hier der Link zum Testscript: Klick!.


MfG Pr0g
BenBE
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 8721
Erhaltene Danke: 191

Win95, Win98SE, Win2K, WinXP
D1S, D3S, D4S, D5E, D6E, D7E, D9PE, D10E, D12P, DXEP, L0.9\FPC2.0
BeitragVerfasst: Sa 03.06.06 16:41 
Naja, da fragst Du hier im DF an der richtigen Stelle, da es in einem der Beta-Tests mit BBCode-Crashing mal einen richtigen Tester-Sport gab ...

Ich hoff mal, dass ich mit folgendem Code nicht den Parser vom DF aushebel:

ausblenden Quelltext
1:
<span class="inlineSyntax">[url="[b]Test"][/b]http:/<!--&NOTCLICKABLE-->/w<!--&NOTCLICKABLE-->ww.delphi-forum.de[/url][b]</span>Hallo DF![/b]					


Die richtige Korrektur wäre in diesem Fall
ausblenden Quelltext
1:
<span class="inlineSyntax">[url="[b]Test"][/b]http:/<!--&NOTCLICKABLE-->/w<!--&NOTCLICKABLE-->ww.delphi-forum.de[/url][b]</span>Hallo DF![b][/b]					


Anstatt deinem etwas falsch verstandenen Block, den dein Parser ausgibt. Alles zwichen [code] und [/code] sollte immer als Literal, d.h. ungeparst betrachtet werden.

Weiterhin: sollte [b]Fett[i]fettkursiv[/b]kursiv[/i] zu [b]Fett[i]fettkursiv[/i][/b][i]kursiv[/i] werden.

Ansonsten ne nette Idee!

_________________
Anyone who is capable of being elected president should on no account be allowed to do the job.
Ich code EdgeMonkey - In dubio pro Setting.
Pr0g Threadstarter
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 220


D7 Pers
BeitragVerfasst: Sa 03.06.06 19:43 
Habe den Parser nun angepasst ;) Du sprachst von einem Beta Test der BBCodes, waren die öffentlich, also gibts da noch nen Thread drüber, in dem vielleicht "schwierige" BBCodes zu finden sind?
Born-to-Frag
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 1094

Win XP SP2, Win 2000 SP4
Delphi 7, 2k5
BeitragVerfasst: Sa 03.06.06 19:49 
[co[b][/b]de]Hallo![/code] wird zu [code]Hallo!

_________________
Theorie ist wenn man alles weiß, aber nichts funktioniert. Praxis ist wenn alles funktioniert, aber niemand weiß warum.
Microsoft vereint Theorie und Praxis: Nichts funktioniert und niemand weiß warum.
BenBE
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 8721
Erhaltene Danke: 191

Win95, Win98SE, Win2K, WinXP
D1S, D3S, D4S, D5E, D6E, D7E, D9PE, D10E, D12P, DXEP, L0.9\FPC2.0
BeitragVerfasst: Sa 03.06.06 19:51 
Nein, davon gibt's keinen öffentlichen Thread, weil die Diskussion dazu im Betatest der DF-Forensoftware stattgefunden hatte und das DF-Team irgendwann (glaub 5-10 der absurdesten Konstrukte wurden bereits gepostet - die allesamt zum Zerschießen des Layouts führten) einfach nix mehr davon hören wollte. Allesamt hatten gemeinsam, dass sie absolut ungültige (und überaus sinnlose) Tagverschachtelungen der Art [tag1="[tag2="[tag3][/tag3]"[/tag2]] oder andere Konstrukte waren, die von vorn herein nicht gültig sein konnten, weshalb das DF-Team dann auch nicht mehr wollte, dass bewusst solche Konstruktionen provoziert wurden. Ggf. kannst Du im Team einmal anfragen, ob sie Dir aus dem Diskussionsthread aus der Betatester-Sparte mal eine Kopie des damaligen Tests geben können.

_________________
Anyone who is capable of being elected president should on no account be allowed to do the job.
Ich code EdgeMonkey - In dubio pro Setting.
Pr0g Threadstarter
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 220


D7 Pers
BeitragVerfasst: Sa 03.06.06 20:35 
@Born-to-Frag: Habs korrigiert, nun wird [co[b][/b]de]Hallo! zurückgegeben.
Regan
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 2157
Erhaltene Danke: 72


Java (Eclipse), Python (Sublimetext 3)
BeitragVerfasst: Sa 03.06.06 20:42 
Aus
ausblenden Quelltext
1:
2:
[b]Hallo leute[/B],<br>
wie findet ihr denn dieses tool?. [u]Toll?[/u] - das ist aber schön.[email]zumir@meinserver.de[email]naja

wird
ausblenden Quelltext
1:
2:
[b]Hallo leute[/B],<br>
wie findet ihr denn dieses tool?. [u]Toll?[/u] - das ist aber schön.[email]zumir@meinserver.denaja[/email]
Pr0g Threadstarter
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 220


D7 Pers
BeitragVerfasst: Sa 03.06.06 21:13 
Ja, das ist aber ein richtigtes Verhalten. Der zweite Email-Tag ist doppelt, daher wurde er entfernt, da aber bis zum Ende kein schließender mehr kam wurde einer hinzugefügt. Somit ist zumindest im späteren HTML Code kein Fehler vorhanden.
BenBE
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 8721
Erhaltene Danke: 191

Win95, Win98SE, Win2K, WinXP
D1S, D3S, D4S, D5E, D6E, D7E, D9PE, D10E, D12P, DXEP, L0.9\FPC2.0
BeitragVerfasst: Sa 03.06.06 22:53 
Ich stimm Regan an dieser Stelle zu, dass das logischere Verhalten wäre, den Email-Tag an der angegebenen Stelle zu schließen,, da eine Verschachtelung kein sinnvoller Tag wäre.

_________________
Anyone who is capable of being elected president should on no account be allowed to do the job.
Ich code EdgeMonkey - In dubio pro Setting.
Pr0g Threadstarter
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 220


D7 Pers
BeitragVerfasst: So 04.06.06 12:53 
Nagut, habe es angepasst. Der Email Tag wird nun geschlossen und nicht entfernt. ;)