Skip to content

Parse Markdown before parsing blade syntax? #67

Closed
@unnawut

Description

@unnawut

In BladeMarkdownEngine::get() the code is as follow:

public function get($path, array $data = [])
{
    $contents = parent::get($path, $data);

    return $this->markdown->convertToHtml($contents);
}

My .md.blade.php contains @extends('layouts.default'). This means that parent::get() has already parsed my blade template and puts loads of HTML into $contents.

When convertToHtml(), which supposed to get only Markdown syntax, gets the fully parsed HTML above, it goes crazy and hence lots of <pre><code> produced.

Is it possible to specify that markdown content in .md.blade.php should be parsed before parsing the rest of blade syntax in that file? If it's not already supported would you welcome a PR that allows that?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions