[OpenAPI] stripping double quotes at the beginning and the end of the response. fixes #99

This commit is contained in:
mic 2024-08-14 22:14:39 +02:00
parent ffc5c465ce
commit ff1c7b1fc1

View file

@ -227,7 +227,8 @@ class MessagesArea extends HTMLElement {
const actionButton = document.createElement('button');
actionButton.textContent = 'Use this answer';
//actionButton.textContent = browser.i18n.getMessage("chatgpt_win_get_answer");
const fullTextHTMLAtAssignment = this.fullTextHTML;
const fullTextHTMLAtAssignment = this.fullTextHTML.trim().replace(/^"|"$/g, '').replace(/^<p>&quot;/, '<p>').replace(/&quot;<\/p>$/, '</p>'); // strip quotation marks
//console.log(">>>>>>>>>>>> fullTextHTMLAtAssignment: " + fullTextHTMLAtAssignment);
actionButton.addEventListener('click', () => {
switch(promptData.action) {
case "1": // do reply