我正在使用 Laravel 5.4,我正在发送带有以下代码的 Markdown 邮件:
public function build()
{
return $this->markdown('emails.userWasRegistered')
->with('user', $this->user);
}
Markdown
@component('mail::message')
# Welcome
Thank you for registering, you are registered as a {{ $user->role }}
@component('mail::button', ['url' => $url])
Login
@endcomponent
@endcomponent
但是输出不是它应该的样子,对吧?
HTML
HTML 来源
知道可能出了什么问题吗?
最佳答案
我知道发生了什么。这是因为您缩进了模板。在 Markdown 中,当你缩进被解释为“代码块”的东西时,如果你明白我的意思,它应该按原样显示而不是计算出来。
like this you <strong>see</strong>?
所以不要缩进你的代码。
关于php - Laravel 5.4 Markdown 邮件字符问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42154871/