Closed nallenscott closed 4 years ago
Thanks for the pull request!
The documentation is rather sparse on the details how this works, would it be possible for you to provide examples of such files, so that this could be tested / validated?
As far as Atom is concerned, they are syntactically identical to a Blade or Markdown template. It's not a hybrid language, just a file that contains both Blade and Markdown. Jigsaw processes the file for Blade, then uses the suffix to determine if the file contains another supported format (e.g., .md, .json, .xml). There are plenty of examples in the tightenco/jigsaw test sources.
Any idea whether PHP syntax still works in those files? Laravel's blade includes everything between <?php
and ?>
as-is to the output and turns most of blade syntax to also equivalent code in PHP*.
**<?php echo 'bold text'; ?>**
Would this be equivalent to this in terms of final result?
**bold text**
Any executable code in blade.md
is escaped. Your example results in <strong><?php echo 'bold text'; ?></strong>
.
It looks like Blade offers a directive for embedding PHP in your templates. I wasn't aware of this and haven't tested it, but I'm assuming it won't highlight properly since I didn't include any PHP patterns in my grammar...
@php // @endphp
blocks are also escaped, so I think we can safely ignore PHP in blade.md
files.
Users will also need to add source.gfm.blade
to the list of grammars in the Atom markdown preview package in order to use the Markdown Preview command on these files.
Thanks for the heads-up. I'll give this another try during the weekend and likely then also merge and do a release.
The PHP grammar was broken because of the missing reference to moved code in the repository. Otherwise it is looking good enough and is flexible for expansion in the future. Thanks again for the pull request.
Add support for hybrid Blade/Markdown syntax used by static site generators like Jigsaw.