The @carve directive converts Carve markup to HTML.
@carve($content)
# Welcome to Carve
This is a paragraph with /emphasis/, *strong*, _underline_ and /*both combined*/.
## Features
- Clean, consistent syntax
- Task lists: `[x]` done, `[-]` dropped, `[>]` deferred
- Much more!
> One syntax, one meaning - and the same HTML from every implementation.
^ The Carve design principles
### Code Example
```php
$html = $carve->toHtml('Hello *world*!');
```
Visit the [Carve organization](https://github.com/markup-carve) for more.
This is a paragraph with emphasis, strong, underline and both combined.
[x] done, [-] dropped, [>] deferredOne syntax, one meaning - and the same HTML from every implementation.
$html = $carve->toHtml('Hello *world*!');
Visit the Carve organization for more.
@carveText($content)
Extracts plain text, useful for search indexing or excerpts:
Welcome to Carve
This is a paragraph with emphasis, strong, underline and both combined.
Features
- Clean, consistent syntax
- Task lists: [x] done, [-] dropped, [>] deferred
- Much more!
"One syntax, one meaning - and the same HTML from every implementation."
The Carve design principles
Code Example
$html = $carve->toHtml('Hello *world*!');
Visit the Carve organization for more.
For user-submitted content, use a safe-mode converter profile via the facade:
{!! Carve::toHtml($content, 'user_content') !!}
## User Comment
This is /user submitted/ content.
It uses *safe mode* to prevent XSS:
<script>alert('xss')</script>
The script tag above will be escaped.
This is user submitted content.
It uses safe mode to prevent XSS:
<script>alert(‘xss’)</script>
The script tag above will be escaped.
@carveRaw($trustedContent)
The @carveRaw directive renders Carve without safe mode. Use it only for content you fully control.