Skip to content

Commit

Permalink
feat: allow HTML output
Browse files Browse the repository at this point in the history
  • Loading branch information
louistiti committed Mar 24, 2019
1 parent 82ebbee commit ec3f02d
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
2 changes: 1 addition & 1 deletion app/js/chatbot.es6.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ export default class Chatbot {

container.className = `bubble-container ${who}`
bubble.className = 'bubble'
bubble.textContent = string
bubble.innerHTML = string

this.feed.appendChild(container).appendChild(bubble)

Expand Down
2 changes: 1 addition & 1 deletion bridges/python/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@
from pathlib import Path
from random import choice
from sys import argv, stdout
from re import findall
from vars import useragent
from tinydb import TinyDB, Query, operations
from time import sleep
import sqlite3
import requests
import re

dirname = path.dirname(path.realpath(__file__))

Expand Down
9 changes: 6 additions & 3 deletions server/src/core/brain.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,16 +48,19 @@ class Brain {
/**
* Make Leon talk
*/
talk (speech) {
talk (rawSpeech) {
log.title('Leon')
log.info('Talking...')

if (speech !== '') {
if (rawSpeech !== '') {
if (process.env.LEON_TTS === 'true') {
// Stripe HTML
const speech = rawSpeech.replace(/<(?:.|\n)*?>/gm, '')

this.tts.add(speech)
}

this.socket.emit('answer', speech)
this.socket.emit('answer', rawSpeech)
}
}

Expand Down

0 comments on commit ec3f02d

Please sign in to comment.