-
Notifications
You must be signed in to change notification settings - Fork 566
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unable to override header formatting #612
Comments
I'm open to creating an MR, but wasn't sure my idea for fixing this is all that great. The only thing I can think of is: let {prefix, lineSeparator, header, footer} = Object.assign({}, defaultFormatting);
if (/* formattting object is not empty */) {
let {prefix, lineSeparator, header, footer} = Object.assign({}, defaultFormatting, formatting);
// The potentially annoying part here is that "header" and "footer" probably need to include
// lineSeparator in their value. E.g. "footer: '\nEND\n'"
} else {
// existing logic
} |
Good catch. Sloppy logic on my part, and also lack of unit tests... Let me know your thoughts on #614. I just moved the default formatting options to the |
Fixes #612 Formatting options in the `fileHeader` format helper function were being overridden by the default formatting options.
This is now fixed and released in 3.0.0-rc.9! I added a test with your use-case to make sure it worked. |
Hi, messing around with the latest 3.0-rc.8 release.
Creating a custom format that will output some HTML to be included in a project as a Twig file. In Twig, comments look like:
{# I'm a comment #}
The full header would be expected to look like:
The issue I'm noticing is that the
fileHeader()
function accepts aformatting
option, but it appears to ultimately be ignored.For example:
The current logic appears to always overwrite the
prefix
,header
andfooter
properties.The text was updated successfully, but these errors were encountered: