Skip to content

Some replacements is special cases are not replaced as expected #27

@GraemeAllanBryce

Description

@GraemeAllanBryce

I have two instances where the replacement values do not work as expected.

The first is in implementing a common pattern for NextJS pages where the eventual file or folder name requires to be an all lowercase term followed by id and wrapped with square brackets - so a file or folder may be named [cityaliasid].

I have a variable templateName: cityAlias.

if I use [___templatename___id] as the value for the filename or the folder the value is not replaced when creating the file or folder. However if I use [___templateName___] the value IS replaced but of course the result includes a capital which needs to be dealt with after the template has run.

The other case is in the replacement of a value within a file where I have a pathname that must be preceded by "/" In this case the template contains path={"/___templatename___"} - again the value is not replaced.

All other instances of variables in the templates and filenames are working exactly as expected and correctly case.

I guess the issues result from RegEx syntax being confused by the character appearing immediately before the template.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions