Download the PHP package fissible/transmark-blade without Composer
On this page you can find all versions of the php package fissible/transmark-blade. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download fissible/transmark-blade
More information about fissible/transmark-blade
Files in fissible/transmark-blade
Package transmark-blade
Short Description Laravel Blade adapter for fissible/transmark: a @transmark directive and
License MIT
Homepage https://github.com/fissible/transmark-blade
Informations about the package transmark-blade
fissible/transmark-blade
Laravel Blade adapter for fissible/transmark: a @transmark directive and <x-transmark> component render a Document (or a DOCX/Markdown file path) as HTML via HtmlWriter.
Requirements
- PHP ^8.2
- Laravel ^10.0, ^11.0, or ^12.0 (
illuminate/support,illuminate/view,illuminate/contracts— nolaravel/frameworkdependency)
Installation
The service provider (Fissible\Transmark\Blade\TransmarkBladeServiceProvider) is auto-discovered.
Usage
TransmarkRenderer::render() accepts either a Fissible\Transmark\Document you already
have, or a .docx/.md/.markdown file path it reads and parses internally (dispatched
by extension). Both the directive and the component accept the same union type.
Blade directive
Blade component
Important: never wrap @transmark(...) in {{ }} or {!! !!}
HtmlWriter (from fissible/transmark) already HTML-escapes text content
(ENT_QUOTES | ENT_SUBSTITUTE | ENT_HTML5). Both the directive and the component
output that already-escaped HTML directly, and neither needs (or accepts) extra
raw-output syntax:
- Directive: use
@transmark(...)bare. It is a Blade directive, not a{{ }}-style expression — its callback returns a complete` snippet that Blade splices in as-is. Wrapping it as{!! @transmark(...) !!}produces a nested; ?>**parse error**. Wrapping it as{{ @transmark(...) }}would additionally re-escape the HTML tagsHtmlWritergenerated (,`, etc.), breaking rendering even if it did compile. - Component:
<x-transmark>renders its own view with{!! $html !!}internally, so<x-transmark :document="$document" />is always safe to use as-is. - The
{!! !!}vs.{{ }}distinction only applies if you skip both of the above and manually echoTransmarkRenderer::render()'s return value as a plain expression — see "Programmatic use" below.
Programmatic use (no Blade)
If you echo $html in a Blade template yourself, use {!! $html !!}, not {{ $html }}
— the latter would double-escape it.
Unsupported file extensions throw Fissible\Transmark\Blade\Exception\UnsupportedFormatException.
License
MIT
All versions of transmark-blade with dependencies
fissible/transmark Version >=0.3 <1.0
illuminate/support Version ^10.0|^11.0|^12.0
illuminate/view Version ^10.0|^11.0|^12.0
illuminate/contracts Version ^10.0|^11.0|^12.0