SPATIE

  • Products
  • Open Source
  • Courses
  • Web Development
VacanciesAboutBlogDocsGuidelinesMerch ↗ Log in

Docs Laravel-markdown Advanced-usage Highlighting lines

Other versions for crawler v1
    • Introduction
    • Support us
    • Requirements
    • Installation & setup
    • Questions and issues
    • Changelog
    • Resources and alternatives
    • About us

    Usage in Blade

    • General usage
    • Configuring code highlighting
    • Rendering anchors
    • Passing options to Commonmark

    Rendering markdown

    • General usage
    • Configuring code highlighting
    • Rendering anchors
    • Passing options to Commonmark

    Advanced usage

    • Highlighting lines
    • Caching results
    • Customizing the rendering process

Highlighting lines

When starting a code block, you can mark lines as highlighted, added, deleted and focus

Certain options can be used when rendering code block.

```php{1,2}{3}
<?php
echo "We're highlighting line 1 and 2";
echo "And focusing line 3";

To know more about the feature, head over the docs of the underlying spatie/commonmark-shiki-highlighter package.

Passing options to Commonmark
Caching results
Help us improve this page
Testing Laravel

Learn how to write quality tests in Pest and PHPUnit in our video course

Help us improve this page
  • Products
  • Open Source
  • Courses
  • Web Development
VacanciesAboutBlogDocsGuidelinesMerch ↗ Log in

Kruikstraat 22, Box 12
2018 Antwerp, Belgium
info@spatie.be
+32 3 292 56 79
  • GitHub
  • Instagram
  • LinkedIn
  • Twitter
  • Bluesky
  • Mastodon
  • YouTube
  • Privacy
  • Disclaimer

+32 3 292 56 79

Our office is closed now, email us instead

    Enter a search term to find results in the documentation.