Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Dindent Laravel Package

schleuse/dindent

Dindent is a regex-based HTML indenter/beautifier for development and testing. It formats template-generated markup with readable indentation without sanitizing, fixing, or rebuilding the document like DOM/Tidy—useful for debugging messy HTML output.

View on GitHub
Deep Wiki
Context7

Product Decisions This Supports

  • Developer Productivity: Expanded HTML formatting capabilities (e.g., <style> tag support, one-line mode) reduce manual formatting overhead for complex templates (e.g., emails with embedded CSS or inline scripts). Multi-line comment handling and optimized speed further streamline debugging workflows.
  • Automated Testing: New features like one-line mode and <pre|textarea> extraction enable precise HTML diffing for edge cases (e.g., minified snippets or code blocks), improving test reliability for dynamic content.
  • Build vs. Buy: The PHP 8.2 requirement (breaking change) justifies adoption for teams already upgrading to modern PHP versions, avoiding custom solutions for HTML normalization. The package’s specialization (no frontend framework overlap) strengthens the "buy" case.
  • Roadmap Priorities:
    • Frontend Tooling: One-line mode and <style> support align with initiatives to standardize HTML output in CI/CD for performance-critical templates (e.g., marketing emails).
    • QA Automation: Multi-line comment handling and speed optimizations reduce flaky tests in regression suites for HTML-heavy features.
    • Developer Experience: Breaking change (PHP 8.2) is offset by zero-config usability and no runtime overhead, reinforcing its role as a lightweight dev tool.

When to Consider This Package

  • Adopt if:
    • Your team uses PHP 8.2+ and debugs/test HTML with embedded CSS, inline scripts, or code blocks (e.g., <pre>, <textarea>).
    • You need one-line HTML formatting for minified snippets or diff-friendly comparisons in tests.
    • Inconsistent HTML indentation causes flaky tests or manual review bottlenecks in Laravel/Blade workflows.
    • You lack a dedicated frontend tool (e.g., Prettier) and want a PHP-native solution.
  • Look elsewhere if:
    • You’re on PHP < 8.2 (requires upgrade; no downgrade path).
    • Your HTML is primarily generated by JS frameworks (React/Vue) where ESLint/Prettier is preferred.
    • You prioritize runtime performance over dev-time formatting (this is a build-time tool).
    • You use a broader HTML linter (e.g., PHP_CSS_Validator) that already handles indentation + validation.

How to Pitch It (Stakeholders)

For Executives: *"This v3.0.0 update turns schleuse/dindent into a Swiss Army knife for HTML formatting—now handling <style> tags, one-line snippets, and code blocks while cutting test flakiness. For teams on PHP 8.2+, it’s a zero-cost upgrade that:

  • Saves QA time by standardizing complex HTML (emails, reports) in CI.
  • Reduces PR noise with precise diffs for dynamic content.
  • Future-proofs your stack by aligning with PHP 8.2’s EOL timeline. ROI: 10-minute setup for 80% cleaner HTML output—a no-brainer for dev-heavy teams."*

For Engineering: *"v3.0.0 adds critical features for Laravel/PHP teams:

  • <style> + inline element support: No more manual fixes for CSS-in-HTML.
  • One-line mode: Perfect for minified snippets or diff-friendly tests.
  • PHP 8.2 requirement: Ensures long-term compatibility (no PHP 8.1 EOL risks). Usage (updated for new features):
// Format with one-line mode for minified diffs
$minified = Dindent::format($html, mode: 'one-line');

// Handle <style> + preserve <pre> blocks
$formatted = Dindent::format($emailTemplate);
assertStringEqualsFile('expected.html', $formatted);

Alternatives (e.g., custom scripts) add maintenance overhead—this does one thing, perfectly, and now handles 90% of real-world HTML cases."*

Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
amashukov/lnd-client-php
althinect/enum-permission
andydefer/laravel-actions
aimeos/prisma
mintobit/jobqueue
a4sex/maintenance-bundle
a4sex/entity-date-update
a4sex/client-identifier
a4sex/base-utilites
a4sex/key-value-storage
a4sex/micro-status
chilldev/dependency-injection-extra
datinglibre/datinglibre-app-api
biberltd/corebundle
bricre/symfony-bundle-test
biberltd/logbundle
dominium/http-adapter-bundle
dominium/google-analytics
a4sex/auto-clean-entity
christhompsontldr/laravel-inky