Skip to content

Commit e8ae09d

Browse files
committed
fix(index.js): fix placeholder replacement
1 parent 9e9dc6c commit e8ae09d

File tree

4 files changed

+4
-2
lines changed

4 files changed

+4
-2
lines changed

example/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
<!-- AUTO-GENERATED-CONTENT:START (travisBadgePlugin:src=./example-template&addNewLine=false) -->
22
[![Travis (.org)](https://img.shields.io/travis/user/repo/master.svg)](https://travis-ci.org/user/repo)
3+
[![Travis (.org)](https://img.shields.io/travis/user/repo/master.svg)](https://travis-ci.org/user/repo)
34
<!-- AUTO-GENERATED-CONTENT:END -->

example/example-template

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1+
[![Travis (.org)](https://img.shields.io/travis/user/repo/{current_branch}.svg)](https://travis-ci.org/user/repo)
12
[![Travis (.org)](https://img.shields.io/travis/user/repo/{current_branch}.svg)](https://travis-ci.org/user/repo)

index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ function applyTransform(data) {
4242
return appendSlash ? `/${branch}` : branch;
4343
}
4444

45-
return data.replace("{current_branch}", branch ? handleSlash() : "");
45+
return data.split("{current_branch}").join(branch ? handleSlash() : "");
4646
}
4747

4848
module.exports = function travisBadgePlugin(content, pluginOptions, config) {

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "markdown-magic-branch-badge",
3-
"version": "0.0.1",
3+
"version": "0.0.2",
44
"description": "A plugin to keep badges updated with branch.",
55
"main": "index.js",
66
"scripts": {

0 commit comments

Comments
 (0)