Skip to content
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

Support preventIndent option #93

Merged
merged 3 commits into from
Apr 29, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
# Change Log

## [Unreleased]
- New `partialDirs` query option allows specifying additional directories to be searched for partials. Thank you @lostthetrail.
- New `partialDirs` query option allows specifying additional directories to be searched for partials. Thank you @lostthetrail.
- New `preventIndent` query option to avoid nested partials adding whitespace to
`textarea` and `pre` elements.

## [1.2.0] - 2016-03-15

Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ The following query options are supported:
- *exclude*: Defines a regex that will exclude paths from resolving. This can be used to prevent helpers from being resolved to modules in the `node_modules` directory.
- *debug*: Shows trace information to help debug issues (e.g. resolution of helpers).
- *partialDirs*: Defines additional directories to be searched for partials. Allows partials to be defined in a directory and used globally without relative paths. See [example](https://github.com/altano/handlebars-loader/tree/master/examples/partialDirs)
- *preventIndent*: Prevent partials from being indented inside their parent template.

See [`webpack`](https://github.com/webpack/webpack) documentation for more information regarding loaders.

Expand Down
3 changes: 2 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,8 @@ module.exports = function(source) {
if (source) {
template = hb.precompile(source, {
knownHelpersOnly: firstCompile ? false : true,
knownHelpers: knownHelpers
knownHelpers: knownHelpers,
preventIndent: query.preventIndent
});
}
} catch (err) {
Expand Down