Using Markdown | laravel-comments | Spatie

 SPATIE

laravel-comments
================

spatie.be/open-source

  [Docs](https://spatie.be/docs)  [Laravel-comments](https://spatie.be/docs/laravel-comments/v1)  Livewire-components  Using Markdown

 Version   v2   v1

 Other versions for crawler [v2](https://spatie.be/docs/laravel-comments/v2) [v1](https://spatie.be/docs/laravel-comments/v1)

- [ Introduction ](https://spatie.be/docs/laravel-comments/v1/introduction)
- [ Getting a license ](https://spatie.be/docs/laravel-comments/v1/getting-a-license)
- [ Requirements ](https://spatie.be/docs/laravel-comments/v1/requirements)
- [ Installation &amp; setup ](https://spatie.be/docs/laravel-comments/v1/installation-setup)
- [ Questions and issues ](https://spatie.be/docs/laravel-comments/v1/questions-issues)
- [ Changelog ](https://spatie.be/docs/laravel-comments/v1/changelog)
- [ About us ](https://spatie.be/docs/laravel-comments/v1/about-us)

Basic usage
-----------

- [ Working with comments ](https://spatie.be/docs/laravel-comments/v1/basic-usage/working-with-comments)
- [ Working with reactions ](https://spatie.be/docs/laravel-comments/v1/basic-usage/working-with-reactions)
- [ Transforming comments ](https://spatie.be/docs/laravel-comments/v1/basic-usage/transforming-comments)
- [ Sending notifications ](https://spatie.be/docs/laravel-comments/v1/basic-usage/sending-notifications)
- [ Approving comments ](https://spatie.be/docs/laravel-comments/v1/basic-usage/approving-comments)
- [ Listing comments in Laravel Nova ](https://spatie.be/docs/laravel-comments/v1/basic-usage/listing-comments-in-laravel-nova)

Livewire components
-------------------

- [ Introduction ](https://spatie.be/docs/laravel-comments/v1/livewire-components/introduction)
- [ Installation ](https://spatie.be/docs/laravel-comments/v1/livewire-components/installation)
- [ Using the components ](https://spatie.be/docs/laravel-comments/v1/livewire-components/using-the-components)
- [ Taking care of authorization ](https://spatie.be/docs/laravel-comments/v1/livewire-components/taking-care-of-authorization)
- [ Customising the views ](https://spatie.be/docs/laravel-comments/v1/livewire-components/customising-the-views)
- [ Miscellaneous options ](https://spatie.be/docs/laravel-comments/v1/livewire-components/miscellaneous-options)
- [ Using Markdown ](https://spatie.be/docs/laravel-comments/v1/livewire-components/using-markdown)
- [ Upgrading laravel-comments-livewire ](https://spatie.be/docs/laravel-comments/v1/livewire-components/upgrading)

      You are viewing the documentation for **an older version** of this package. You can check the version you are using with the following command:

 `                                    composer show spatie/laravel-comments                                                                                                                                                                                                                                    `

Using Markdown
==============

###  On this page

1. [ Links ](#content-links)
2. [ Images ](#content-images)
3. [ Bold text ](#content-bold-text)
4. [ Italics ](#content-italics)
5. [ Titles ](#content-titles)
6. [ Creating a list ](#content-creating-a-list)
7. [ Code blocks ](#content-code-blocks)
8. [ Inline code ](#content-inline-code)
9. [ Learning more ](#content-learning-more)

Comments can be entered using Markdown, a simple set of rules to apply styling. Think of it as vastly simplified HTML so that it's very easy to type for both developers and non-developers.

On this page, you can learn the most commonly used Markdown markup.

Links
-----------------------------------------------------------------------

To create a link, put the name of the link between `[]` and the URL between `()`. Here is an example:

```
[The Beatles](https://thebeatles.com) are a well known band.
```

will be rendered as

[The Beatles](https://thebeatles.com) are a well known band.

Images
--------------------------------------------------------------------------

To link to an image, you can do the same as creating a link. Put the title between `[]` and the URL between `()`. Additionally, add a `!` before the opening `[`.

```
Here is an image of the Beatles:

![The Beatles](/docs/laravel-comments/v1/images/beatles.jpg)
```

The above will be rendered as:

Here is an image of the Beatles:

![The Beatles](/docs/laravel-comments/v1/images/beatles.jpg)

Bold text
-----------------------------------------------------------------------------------

You can make text bold by wrapping it between `**`.

```
The Beatles are a **well known** band.
```

The above will be rendered as:

The Beatles are a **well known** band.

Italics
-----------------------------------------------------------------------------

You can make text italics by wrapping it between `_`.

```
The Beatles are a _well known_ band.
```

The above will be rendered as:

The Beatles are a *well known* band.

Titles
--------------------------------------------------------------------------

You can create a title by letting a sentence start with `#`. The more `#` you add, the smaller the title will render

```
# The Beatles are a _well known_ band
## The Beatles are a _well known_ band
### The Beatles are a _well known_ band
```

The above will be rendered as:

The Beatles are a well known band
===========================================================================================================================================================

The Beatles are a well known band
-------------------------------------------------------------------------------------------------------------------------------------------------------------

### The Beatles are a well known band

Creating a list
-----------------------------------------------------------------------------------------------------

To create list, each item should be on its own line and start with `-`

```
The Beatles consist of

- John
- Paul
- George
- Ringo
```

This above will be rendered as:

The Beatles consist of

- John
- Paul
- George
- Ringo

To create a numbered list, start each line with a `1.`. You can increment the number, but this isn't necessary.

```
The Beatles consist of

1. John
1. Paul
1. George
1. Ringo
```

This above will be rendered as:

The Beatles consist of

1. John
2. Paul
3. George
4. Ringo

Code blocks
-----------------------------------------------------------------------------------------

Code blocks can be highlighted by wrapping the code between ```.

Optionally, you can add the name of language after the opening backticks to hint in which language the code should be highlighted.

You can use any of [these languages](https://github.com/shikijs/shiki/blob/main/docs/languages.md#all-languages) that are support by Shiki (which is used under the hood to highlight code).

```php
$revolution = 9;
```

This will be rendered as

```
$revolution = 9;
```

Inline code
-----------------------------------------------------------------------------------------

To style text as code in the middle of a sentence, wrap the code between backticks

```
The `getBack()` function can be used to redirect back.
```

The above will be rendered as:

The `getBack()` function can be used to redirect back.

Learning more
-----------------------------------------------------------------------------------------------

The examples are this page are the most commonly used Markdown markup. To learn more formatting possibilities, head over [the basic syntax guide of the Markdown guide](https://www.markdownguide.org/basic-syntax/).
