shufo / prettier-plugin-blade

Format your blade template using Prettier
https://www.npmjs.com/package/@shufo/prettier-plugin-blade
MIT License
324 stars 8 forks source link

[Formatting Bug]: custom directives support? #289

Open kukac7 opened 4 months ago

kukac7 commented 4 months ago

Version

latest

Template before formatting

@hasfield('list')
  <ul>
    @fields('list')
      <li>@sub('item')</li>
    @endfields
  </ul>
@endfield

Template after formatting

Error formatting document.

Expected Behaviour

hi,

is it possible to somehow increase the number of supported directives? it seems that the https://github.com/log1x/sage-directives composer package is not supported. it says an error when formatting: Error formatting document.

thanks for the help!

Relevant log output

No response

github-actions[bot] commented 2 months ago

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days

shufo commented 1 month ago

Currently supported custom directive format is @~~~ with @end~~~. (~~~ must matched with start and end directive)

If sage-directive's @endfield was @endhasfield, it works as expected.

@hasfield('list')
  <ul>
    @fields('list')
      <li>@sub('item')</li>
    @endfields
  </ul>
@endhasfield