add postprocess

This commit is contained in:
2017-05-31 23:59:39 +02:00
parent 0b14cca8cc
commit 02aaa042f3
8 changed files with 65 additions and 2 deletions

View File

@@ -0,0 +1,16 @@
import * as plugins from './smarthbs.plugins'
let safeSyntaxBeginRegex = /{-{/g
let safeSyntaxEndRegex = /}-}/g
/**
* allows you to keep handlebars in place across multiple iterations
* helpful when handlebars syntax is used by more than one tool in a build chain
*/
export let postprocess = async (stringArg: string): Promise<string> => {
let processedString = stringArg
processedString = processedString.replace(safeSyntaxBeginRegex, '{{')
processedString = processedString.replace(safeSyntaxEndRegex, '}}')
return processedString
}