diff options
author | Alex Tatiyants <atatiyan@gmail.com> | 2016-01-07 07:44:48 -0800 |
---|---|---|
committer | Alex Tatiyants <atatiyan@gmail.com> | 2016-01-07 07:44:48 -0800 |
commit | 721c4a49c47460f1618a0f679fe9125a5f519cdc (patch) | |
tree | de9ef56e05163272f904aa83fb320e1df9f48292 /app/services/syntax-highlight-service.ts | |
parent | 7363d83b6df50f6cd31f15aebe2ace95d13a2e00 (diff) |
fix various build issues
Diffstat (limited to 'app/services/syntax-highlight-service.ts')
-rw-r--r-- | app/services/syntax-highlight-service.ts | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/app/services/syntax-highlight-service.ts b/app/services/syntax-highlight-service.ts index 17f6e61..93ccb99 100644 --- a/app/services/syntax-highlight-service.ts +++ b/app/services/syntax-highlight-service.ts @@ -7,9 +7,8 @@ export class SyntaxHighlightService { highlight(code: string, keyItems: Array<string>) { hljs.registerLanguage('sql', LANG_SQL); - hljs.configure({ - tabReplace: ' ', // 4 spaces + tabReplace: ' ' }); // prior to syntax highlighting, we want to tag key items in the raw code. making the @@ -17,12 +16,12 @@ export class SyntaxHighlightService { // makes it simpler to find the items we're looing for var result: string = code.toUpperCase().replace(', ', ','); _.each(keyItems, (keyItem: string) => { - result = result.replace(keyItem.toUpperCase(), `${this.OPEN_TAG}${keyItem}${this.CLOSE_TAG}`) + result = result.replace(keyItem.toUpperCase(), `${this.OPEN_TAG}${keyItem}${this.CLOSE_TAG}`); }); result = hljs.highlightAuto(result).value; - result = result.replace(new RegExp(this.OPEN_TAG, 'g'), "<span class='code-key-item'>") - result = result.replace(new RegExp(this.CLOSE_TAG, 'g'), "</span>"); + result = result.replace(new RegExp(this.OPEN_TAG, 'g'), `<span class='code-key-item'>`); + result = result.replace(new RegExp(this.CLOSE_TAG, 'g'), '</span>'); return result; } @@ -185,4 +184,4 @@ export var LANG_SQL = function(hljs) { COMMENT_MODE ] }; -} +}; |