Skip to content
This repository has been archived by the owner on Sep 13, 2023. It is now read-only.

Commit

Permalink
trim value befpre addinng
Browse files Browse the repository at this point in the history
  • Loading branch information
saurabhdaware committed Jun 4, 2020
1 parent cefee98 commit 61a8657
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 10 deletions.
35 changes: 27 additions & 8 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,39 +1,49 @@
# Changelog

## v0.1.11

- Trim value before adding.

## v0.1.10

- **BREAKING CHANGE**, **SECURITY UPDATE**
To use `require()` in the template, user will have to pass `allowRequire: true` in option. This option is by default set to false.
To use `require()` in the template, user will have to pass `allowRequire: true` in option. This option is by default set to false.
```js
const newHTMLTemplate = abellRenderer.render(
myAbellTemplate,
mySandbox,
{allowRequire: true}
);
const newHTMLTemplate = abellRenderer.render(myAbellTemplate, mySandbox, {
allowRequire: true
});
```

## v0.1.9

- Fix to recursively find and create nested `.abell` files

## v0.1.8

- basePath is set to paths relative to input files.

## v0.1.7

- **BUG FIX**
Allowing CLI to build without output path

## v0.1.6

- **MAJOR CHANGE**
Added ability to escape the brackets with a slash('\')

## v0.1.5

- Support for expression after `require` (e.g. `require('module1').someProperty`)
- Build a folder with CLI (Issue: [#6](https://github.com/abelljs/abell-renderer/issues/6), PR: [#8](https://github.com/abelljs/abell-renderer/pull/8), Thanks to [@Pika1998](https://github.com/Pika1998))

## v0.1.4

- Error handling when the temlate does not have any `{{` `}}`
- More tests written for `render()` function

## v0.1.3

- Refactoring of major logic
- Conditions executed as assignment bug fixed
- More tests added in Unit Testing.
Expand All @@ -42,28 +52,35 @@
- Template build time added to CLI

## v0.1.2

BREAKING CHANGE

- `abell-renderer [flags]` changed to `abell-renderer build [flags]`
- `help, --version` added.

## v0.1.1

Bug that stored last value and printed it when assignment was used, fixed.

## v0.1.0

Better log messages added in CLI

## v0.1.0-beta.1

- CLI added to render `.abell` files

## v0.1.0-alpha.2

- Support for nodejs modules

## v0.1.0-alpha.1

- Sequential compilation of JavaScript [#2](https://github.com/abelljs/abell-renderer/issues/2)
- Require values from json/js in .abell files


## v0.0.3

Ability to add functions inside curly brackets

```js
Expand All @@ -75,11 +92,13 @@ Ability to add functions inside curly brackets
```

outputs:

```html
<div>
8
</div>
```

## < v0.0.2
Initilization and overall setup

Initilization and overall setup
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "abell-renderer",
"version": "0.1.10",
"version": "0.1.11",
"description": "A wrapper arround Mustache that adds some additional features and some syntatic sugar required for abell",
"main": "dist/index.js",
"bin": {
Expand Down
2 changes: 1 addition & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ function render(
*/

const toAddOnIndex = match.index; // Gets the index where the executed value is to be put.
renderedHTML += input.slice(lastIndex, toAddOnIndex) + value;
renderedHTML += input.slice(lastIndex, toAddOnIndex) + String(value).trim();
lastIndex = toAddOnIndex + match[0].length;
}

Expand Down

0 comments on commit 61a8657

Please sign in to comment.