From 98acdcb602bdf1e95d3e4838edcc766e9b2d4661 Mon Sep 17 00:00:00 2001 From: Ahmed Alshakh Date: Sun, 24 May 2015 14:49:34 -0600 Subject: [PATCH] choose the quote symbol around string added last argument with the quote [default = '] --- src/Styler.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/Styler.ts b/src/Styler.ts index bd5f403..dabc26f 100644 --- a/src/Styler.ts +++ b/src/Styler.ts @@ -35,12 +35,15 @@ module ObjectStyler { endlStyleName : string; blockIndentStyleName:string; - constructor(essentialStyles : EssentialStyles, styles : Style[]) { + quoteSymbol:string; + constructor(essentialStyles : EssentialStyles, styles : Style[], quote : string = "'") { this.styles = styles; this.punctuationStyleName = essentialStyles.punctuation; this.endlStyleName = essentialStyles.endLine; this.blockIndentStyleName = essentialStyles.blockIndent; + + this.quoteSymbol = quote; } style(object: Object, styleDisc: StyleDiscription) : HTML { @@ -50,7 +53,7 @@ module ObjectStyler { private styleValue(value : string|boolean|number, activatedSyls: string[]) { var html = ""; if(typeof value === "string") { - var quote = this.styleSpan("\"", [this.punctuationStyleName] ); + var quote = this.styleSpan(this.quoteSymbol, [this.punctuationStyleName] ); html += this.styleSpan(quote + parseStringValue(value) + quote,activatedSyls);