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

Commonmark Attributes Extension Laravel Package

webuni/commonmark-attributes-extension

Adds Kramdown-style attribute lists to League/CommonMark markdown, letting you assign HTML ids, classes, and other attributes to block and span elements. Deprecated: use the built-in Attributes extension in league/commonmark 1.5+ instead.

View on GitHub
Deep Wiki
Context7

Product Decisions This Supports

  • Content Customization Without HTML Expertise: Enables authors to add HTML attributes (e.g., classes, IDs) directly in Markdown via {.class}text{} syntax, reducing reliance on raw HTML. Aligns with user-friendly content tools (e.g., wikis, docs, or CMS platforms) where non-technical users need styling/semantic control.
  • Migration to Modern Stack: Justifies upgrading from deprecated webuni/commonmark-attributes-extension to league/commonmark v1.5+, eliminating technical debt and standardizing on a maintained, feature-rich parser. Supports Laravel’s long-term roadmap for PHP 8.x+ compatibility.
  • Feature Parity with Competitors: Matches capabilities of tools like GitHub Flavored Markdown (GFM) or Kramdown, where attributes (e.g., {#toc}) are natively supported. Critical for developer tools or open-source projects competing on markdown flexibility.
  • Build vs. Buy: Avoids reinventing a Markdown parser; leverages league/commonmark’s batteries-included approach (attributes, tables, footnotes) instead of piecemeal extensions. Reduces integration complexity and maintenance burden.
  • Use Cases:
    • Documentation Systems: Add tooltips, syntax highlighting, or collapsible sections via attributes (e.g., {.admonition}Warning{}).
    • CMS/Editor Plugins: Enable WYSIWYG editors (e.g., TipTap, ProseMirror) to translate Markdown attributes to HTML without manual intervention.
    • Data Annotation: Tag Markdown elements for post-processing (e.g., {.chart}data{} → auto-generate graphs via JavaScript).
    • Accessibility: Add aria-* attributes to Markdown for screen readers (e.g., {: aria-label="Download"}link{}).

When to Consider This Package

  • Do Adopt If:

    • You’re locked into league/commonmark <1.5 and need attribute support immediately (e.g., for a legacy system with no upgrade path).
    • Your team prioritizes short-term gains over long-term maintainability (e.g., a prototype or proof-of-concept).
    • You’re using this package as a temporary bridge while planning a migration to league/commonmark v1.5+.
    • Your use case requires minimal attributes (e.g., simple classes/IDs) and doesn’t need advanced features like attribute validation or custom parsers.
  • Look Elsewhere If:

    • You’re using league/commonmark v1.5+: The native Attributes extension is superior (actively maintained, no deprecation risk).
    • You need active development: This package is archived; the replacement is part of a major library with regular updates.
    • Your stack uses PHP 8.x: Risk of compatibility issues; upgrade league/commonmark instead.
    • You require complex attribute logic: Extend league/commonmark directly or use a higher-level tool (e.g., Markdown + JavaScript post-processing).
    • Your team lacks PHP/Laravel expertise: The migration to league/commonmark v1.5+ is low-risk but requires coordination.

How to Pitch It (Stakeholders)

For Executives: *"This package is a stopgap, not a long-term solution. Right now, it lets our content team add HTML classes/IDs directly in Markdown (e.g., {.highlight}code{}), which improves authoring workflows without requiring HTML knowledge. However, it’s deprecated—its functionality is already built into the newer version of league/commonmark (v1.5+), which we should adopt to:

  • Eliminate technical debt (no more abandoned packages).
  • Future-proof our stack (PHP 8.x compatibility, active maintenance).
  • Reduce costs (no custom patches or forks). The switch is low-risk: a one-line Composer update and minimal code changes. Let’s prioritize this as part of our [QX roadmap] to align with modern tooling."*

For Engineers: *"Avoid this package. It’s deprecated, and its features are already in league/commonmark v1.5+ under League\CommonMark\Extension\Attributes. Here’s the drop-in replacement:

  1. Update composer.json:
    "league/commonmark": "^1.5"
    
  2. Replace the extension:
    // Old (deprecated)
    $environment->addExtension(new \Webuni\CommonMark\AttributesExtension\AttributesExtension());
    
    // New (recommended)
    $environment->addExtension(new \League\CommonMark\Extension\Attributes\AttributesExtension());
    

Why this matters:

  • No forks: Uses the official, maintained version.
  • Performance: Bundled extensions are optimized.
  • Security: Active vulnerability patches. Action: Let’s audit our markdown pipeline this sprint to confirm compatibility and flip the switch. If you’re blocked by legacy code, we’ll isolate the change and phase it out."*

For Content/Design Teams: "This change lets you keep using Markdown attributes (like {.button}Click Me{}) but on a more reliable system. No learning curve—just better stability. Behind the scenes, we’re switching to a newer library that’s actively improved, so your workflow stays the same while our tech stack gets an upgrade. Win-win!"

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.
terminal42/code-quality-tools
codifyo/ts-generator-bundle
andydefer/laravel-cluster
testo/fiber
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