Groups | Search | Server Info | Login | Register
Groups > de.comp.lang.php > #4981
| Path | csiph.com!eternal-september.org!feeder.eternal-september.org!.POSTED!not-for-mail |
|---|---|
| From | Andreas Borutta <borumat@gmx.de> |
| Newsgroups | de.comp.lang.php |
| Subject | Re: "Prettify" (Umbrüche, Leerzeichen) vor dem Ausliefern |
| Date | Wed, 19 Nov 2025 20:17:27 +0100 |
| Organization | A noiseless patient Spider |
| Lines | 82 |
| Message-ID | <2gsf4lr3fd6.dlg@borumat.de> (permalink) |
| References | <1e5jhd9og7z4l.dlg@borumat.de> <1t6909b12ei32e282n3e8%sfroehli@Froehlich.Priv.at> <1f6z9pqbuv8xj$.dlg@borumat.de> <1t6909e0efi34eabbn3e8%sfroehli@Froehlich.Priv.at> <tdnp2t2a2dux$.dlg@borumat.de> |
| MIME-Version | 1.0 |
| Content-Type | text/plain; charset="utf-8" |
| Content-Transfer-Encoding | 8bit |
| Injection-Date | Wed, 19 Nov 2025 19:17:28 +0000 (UTC) |
| Injection-Info | dont-email.me; posting-host="5adb125938a19929a4f392a27eac6c77"; logging-data="2597651"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1838bOKpqeOrUsoqlxcB67+0AkGAwxdp0I=" |
| User-Agent | 40tude_Dialog/2.0.15.41de (d7357ef6.233.340) |
| Cancel-Lock | sha1:bGcngGBzRIaeDEuotf4tgH5LH4o= |
| Xref | csiph.com de.comp.lang.php:4981 |
Show key headers only | View raw
Andreas Borutta:
>> Es gibt natürlich einen: <https://htmltidy.net/>, aber im Grund
>> genommen hilft Dir der so viel oder so wenig wie die mit (1)
>> referenzierte man-Page auch.
>
> Ich werde berichten, wenn mir das "page-render-after" gelungen ist.
Es ist mir wider Erwarten ; ) gelungen tidy vor dem Ausliefern des
HTML anzuwenden.
Also nochmal danke für deinen Hinweis : )
Mein Test, ob Tidy verfügbar ist:
/tidy-checkup.php:
<?php
if (class_exists('tidy')) {
echo "✓ Tidy ist verfügbar";
} else {
echo "✗ Tidy ist NICHT verfügbar";
}
/site/plugins/html-tidy/index.php
<?php
use Kirby\Cms\App;
use Kirby\Template\Template;
class TidyTemplate extends Template
{
public function render(array $data = []): string
{
$kirby = App::instance();
$html = parent::render($data);
if (
$kirby->option('debug') === true &&
class_exists('tidy')
) {
$config = [
'indent' => true,
'indent-spaces' => 2,
'wrap' => 0,
'output-html' => true,
'omit-optional-tags' => true,
'doctype' => 'html5',
'tidy-mark' => false
];
$tidy = new tidy();
$tidy->parseString($html, $config, 'utf8');
$tidy->cleanRepair();
return (string) $tidy;
}
return $html;
}
}
Kirby::plugin('andreas/html-tidy', [
'components' => [
'template' => function (App $kirby, string $name, string
$contentType = null) {
return new TidyTemplate($name, $contentType);
}
]
]);
Unter den enorm vielen Optionen muss ich mir noch das Passende suchen.
https://api.html-tidy.org/tidy/quickref_5.8.0.html
Optionale Anführungszeichen in Attributwerten zu entfernen konnte Tidy
wohl mal, kann es aber jetzt nicht mehr.
Andreas
--
http://fahrradzukunft.de
Back to de.comp.lang.php | Previous | Next — Previous in thread | Next in thread | Find similar
"Prettify" (Umbrüche, Leerzeichen) vor dem Ausliefern Andreas Borutta <borumat@gmx.de> - 2025-11-04 00:36 +0100
Re: "Prettify" (Umbrüche, Leerzeichen) vor dem Ausliefern Stefan+Usenet@Froehlich.Priv.at (Stefan Froehlich) - 2025-11-04 07:57 +0000
Re: "Prettify" (Umbrüche, Leerzeichen) vor dem Ausliefern Andreas Borutta <borumat@gmx.de> - 2025-11-04 09:17 +0100
Re: "Prettify" (Umbrüche, Leerzeichen) vor dem Ausliefern Claus Reibenstein <creibens@gmail.com> - 2025-11-04 11:33 +0100
Re: "Prettify" (Umbrüche, Leerzeichen) vor dem Ausliefern Stefan+Usenet@Froehlich.Priv.at (Stefan Froehlich) - 2025-11-04 11:26 +0000
Re: "Prettify" (Umbrüche, Leerzeichen) vor dem Ausliefern Andreas Borutta <borumat@gmx.de> - 2025-11-04 20:36 +0100
Re: "Prettify" (Umbrüche, Leerzeichen) vor dem Ausliefern Andreas Borutta <borumat@gmx.de> - 2025-11-19 20:17 +0100
Re: "Prettify" (Umbrüche, Leerzeichen) vor dem Ausliefern Andreas Borutta <borumat@gmx.de> - 2025-11-19 21:24 +0100
Re: "Prettify" (Umbrüche, Leerzeichen) vor dem Ausliefern Andreas Borutta <borumat@gmx.de> - 2025-11-20 01:16 +0100
Re: "Prettify" (Umbrüche, Leerzeichen) vor dem Ausliefern Andreas Borutta <borumat@gmx.de> - 2025-11-21 17:59 +0100
Re: "Prettify" (Umbrüche, Leerzeichen) vor dem Ausliefern Markus Heinz <markus.heinz@uni-dortmund.de> - 2025-11-22 01:12 +0100
Re: "Prettify" (Umbrüche, Leerzeichen) vor dem Ausliefern Andreas Borutta <borumat@gmx.de> - 2025-11-26 14:21 +0100
Re: "Prettify" (Umbrüche, Leerzeichen) vor dem Ausliefern Andreas Borutta <borumat@gmx.de> - 2025-11-27 08:42 +0100
Re: "Prettify" (Umbrüche, Leerzeichen) vor dem Ausliefern Andreas Borutta <borumat@gmx.de> - 2025-11-28 09:35 +0100
Re: "Prettify" (Umbrüche, Leerzeichen) vor dem Ausliefern Arno Welzel <usenet@arnowelzel.de> - 2025-11-28 10:51 +0100
Re: "Prettify" (Umbrüche, Leerzeichen) vor dem Ausliefern Andreas Borutta <borumat@gmx.de> - 2025-12-04 14:21 +0100
Re: "Prettify" (Umbrüche, Leerzeichen) vor dem Ausliefern Arno Welzel <usenet@arnowelzel.de> - 2025-12-07 15:43 +0100
Re: "Prettify" (Umbrüche, Leerzeichen) vor dem Ausliefern Andreas Borutta <borumat@gmx.de> - 2025-12-07 20:09 +0100
Re: "Prettify" (Umbrüche, Leerzeichen) vor dem Ausliefern Stefan+Usenet@Froehlich.Priv.at (Stefan Froehlich) - 2025-12-07 19:36 +0000
Re: "Prettify" (Umbrüche, Leerzeichen) vor dem Ausliefern Andreas Borutta <borumat@gmx.de> - 2025-12-07 21:55 +0100
Re: "Prettify" (Umbrüche, Leerzeichen) vor dem Ausliefern Stefan+Usenet@Froehlich.Priv.at (Stefan Froehlich) - 2025-12-08 09:07 +0000
Re: "Prettify" (Umbrüche, Leerzeichen) vor dem Ausliefern Andreas Borutta <borumat@gmx.de> - 2025-12-11 14:07 +0100
Re: "Prettify" (Umbrüche, Leerzeichen) vor dem Ausliefern Stefan+Usenet@Froehlich.Priv.at (Stefan Froehlich) - 2025-12-11 18:45 +0000
Re: "Prettify" (Umbrüche, Leerzeichen) vor dem Ausliefern Arno Welzel <usenet@arnowelzel.de> - 2025-12-15 12:23 +0100
Re: "Prettify" (Umbrüche, Leerzeichen) vor dem Ausliefern Andreas Borutta <borumat@gmx.de> - 2025-11-08 07:20 +0100
Re: "Prettify" (Umbrüche, Leerzeichen) vor dem Ausliefern Stefan+Usenet@Froehlich.Priv.at (Stefan Froehlich) - 2025-11-08 10:05 +0000
Re: "Prettify" (Umbrüche, Leerzeichen) vor dem Ausliefern Andreas Borutta <borumat@gmx.de> - 2025-11-08 18:10 +0100
Re: "Prettify" (Umbrüche, Leerzeichen) vor dem Ausliefern Stefan+Usenet@Froehlich.Priv.at (Stefan Froehlich) - 2025-11-08 19:50 +0000
Re: "Prettify" (Umbrüche, Leerzeichen) vor dem Ausliefern Arno Welzel <usenet@arnowelzel.de> - 2025-11-10 01:58 +0100
Re: "Prettify" (Umbrüche, Leerzeichen) vor dem Ausliefern Andreas Borutta <borumat@gmx.de> - 2025-11-10 09:52 +0100
Re: "Prettify" (Umbrüche, Leerzeichen) vor dem Ausliefern Andreas Borutta <borumat@gmx.de> - 2025-11-10 09:53 +0100
Re: "Prettify" (Umbrüche, Leerzeichen) vor dem Ausliefern Stefan+Usenet@Froehlich.Priv.at (Stefan Froehlich) - 2025-11-10 09:20 +0000
Re: "Prettify" (Umbrüche, Leerzeichen) vor dem Ausliefern Arno Welzel <usenet@arnowelzel.de> - 2025-11-10 11:12 +0100
Re: "Prettify" (Umbrüche, Leerzeichen) vor dem Ausliefern Stefan+Usenet@Froehlich.Priv.at (Stefan Froehlich) - 2025-11-10 11:09 +0000
Re: "Prettify" (Umbrüche, Leerzeichen) vor dem Ausliefern Arno Welzel <usenet@arnowelzel.de> - 2025-11-10 17:51 +0100
Re: "Prettify" (Umbrüche, Leerzeichen) vor dem Ausliefern Stefan+Usenet@Froehlich.Priv.at (Stefan Froehlich) - 2025-11-11 08:09 +0000
Re: "Prettify" (Umbrüche, Leerzeichen) vor dem Ausliefern Arno Welzel <usenet@arnowelzel.de> - 2025-11-11 10:16 +0100
Re: "Prettify" (Umbrüche, Leerzeichen) vor dem Ausliefern Stefan+Usenet@Froehlich.Priv.at (Stefan Froehlich) - 2025-11-11 10:03 +0000
csiph-web