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

Incorrect string replacement more than one source #39

Closed
arpanmukherjee1 opened this issue Nov 5, 2015 · 1 comment
Closed

Incorrect string replacement more than one source #39

arpanmukherjee1 opened this issue Nov 5, 2015 · 1 comment

Comments

@arpanmukherjee1
Copy link

@VFK

I have two html files that needs to be processed with similar blocks.

My gulpfile task:

//process view files - fix paths
gulp.task('process-view', function () {
    return gulp.src([
        './index.html',
        './admin.html'
        ])
        .pipe(htmlreplace({
        css: 'assets/style.min.css',
        js: {
            src: [['js/context.min.js', 'js/require.js']],
            tpl: '<script data-main="%s" src="%s"></script>'
        }
    }))
        .pipe(gulp.dest('./dist/views'));
});

My HTML(s) all look like:

<!DOCTYPE html>
<html>
<head>
    <title></title>
    <!-- build:css -->
    <link href="../assets/font-awesome.css" rel="stylesheet" />
    <link href="../assets/pnotify.custom.min.css" rel="stylesheet" />
    <!-- endbuild -->

    <!-- build:js -->
    <script src="../lib/jquery-2.1.3.min.js"></script>
    <script data-main="../js/bootstrapper" src="../lib/require.js"></script>
    <!-- endbuild -->
</head>
<body>
</body>
</html>

The problem lies with the second source file (./admin.html).
The output (NOTE: line-breaks were removed):

<!DOCTYPE html>
<html>
<head>
    <title></title>
    <link rel="stylesheet" href="assets/style.min.css">
    <script data-main="<script data-main="%s" src="%s"></script>" src="js/context.min.js"></script> js/require.js
</head>
<body>
</body>
</html>

Please suggest a workaround for this.

@VFK VFK closed this as completed in c0eef0c Nov 21, 2015
@VFK
Copy link
Owner

VFK commented Nov 21, 2015

Hi @arpanmukherjee1 this is actually a very good find, sorry for the delay in fixing it. Please try v1.5.5

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants