Skip to content
This repository has been archived by the owner on Jul 11, 2019. It is now read-only.

Commit

Permalink
remove html to vdom conversion
Browse files Browse the repository at this point in the history
  • Loading branch information
Flet committed Apr 30, 2015
1 parent 17be8f3 commit 933fea2
Showing 1 changed file with 0 additions and 15 deletions.
15 changes: 0 additions & 15 deletions lib/rich-message.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,9 @@ module.exports.mergeMessages = mergeMessages
var emoji = require('markdown-it-emoji')
var ghlink = require('ghlink')
var higlight = require('highlight.js')
var htmlToVDom = require('html-to-vdom')
var MarkdownIt = require('markdown-it')
var twemoji = require('twemoji')
var util = require('./util.js')
var VNode = require('virtual-dom/vnode/vnode')
var VText = require('virtual-dom/vnode/vtext')

var md = new MarkdownIt({
linkify: true,
Expand All @@ -32,15 +29,6 @@ md.renderer.rules.emoji = function (token, index) {
return twemoji.parse(token[index].content)
}

var convertHTML = htmlToVDom({
VNode: VNode,
VText: VText
})

function makeVDom (html) {
return convertHTML('<div class="text">' + html + '</div>')
}

function makeRichMessage (message, username) {
message.anon = /Anonymous/i.test(message.username)
message.avatar = message.anon
Expand All @@ -57,14 +45,11 @@ function makeRichMessage (message, username) {
var classStr = highlight ? ' class="highlight"' : ''
message.html = '<div' + classStr + '>' + message.html + '</div>'

message.vdom = makeVDom(message.html)

return message
}

function mergeMessages (message1, message2) {
message1.text += '\n' + message2.text
message1.html += '<p></p>' + message2.html
message1.vdom = makeVDom(message1.html)
return message1
}

0 comments on commit 933fea2

Please sign in to comment.