Skip to content
This repository has been archived by the owner on Nov 24, 2018. It is now read-only.

Commit

Permalink
choose the quote symbol around string
Browse files Browse the repository at this point in the history
added last argument with the quote [default = ']
  • Loading branch information
alshakh committed May 24, 2015
1 parent 75b645b commit 98acdcb
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/Styler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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);

Expand Down

0 comments on commit 98acdcb

Please sign in to comment.