These are chat archives for developit/peach.cool

22nd
Jan 2016
Jason Miller
@developit
Jan 22 2016 00:58
whaaaa
no way I have not even seen that yet
lol
got an example json?
Jackson Palmer
@ummjackson
Jan 22 2016 03:16
holy crap i figured it out
if (attributes) {

 // attributes.reverse();

for (var i = attributes.length - 1; i >= 0; i--) {
  attribute = attributes[i];

  var tag; if (attribute.type == 'bold') { tag = 'b' } else { tag = 'em' };

  string = string.substring(0, attribute.range[0]) + '<' + tag + '>' + string.substring(attribute.range[0], attribute.range[0]+attribute.range[1]) + '</' + tag + '>' + string.substring(attribute.range[0] + attribute.range[1]);

}

return string;

}
this is how the message JSON is formatted
blob
Jason Miller
@developit
Jan 22 2016 20:19
ah man I'm so spoiled by JSX
check out how nectarine renders messages, totally going to add formatting support this weekend:
https://github.com/developit/nectarine/blob/master/src/lib/parse-message.js
Jason Miller
@developit
Jan 22 2016 20:32
@ummjackson is it only bold and italic for now?