When working with Node-RED, double quotes in messages are transformed into "

I have a project in the works to create a calendar application for my IoT web app. I am utilizing Node-RED for this task. However, when I pass the message, the double quotes are being converted to "

events = [
    {
        " occ": "1",
        "first": "1",
        "sec": "2",
        "third": "2019",
        "start": "11",
        "end": "12"
    } 

];

The conversion results in the appearance shown in the image:

Answer №1

Without knowing the specifics of your flow and the nodes you are utilizing, it's difficult to provide a definitive answer.

It appears that you may be utilizing the Template node within the core to generate the message payload. The Template node uses mustache syntax which automatically escapes certain characters to ensure they are HTML-safe. To override this behavior, you can use {{{triple-braces}}} instead of the default {{double-brace}}. This information is available in the sidebar help for the Template node.

Answer №2

When your code is being executed in the browser, you have the option to utilize the following function for transforming HTML symbols into real characters:

function convertHtmlSymbolsToChars(input) {
    const textArea = document.createElement('textarea')
    textArea.innerHTML = input;
    return textArea.value;
}

events = convertHtmlSymbolsToChars(events[0][0])

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Updating state from a React mapping component: A step-by-step guide

I am working on an API that needs data filtering and then I want to place the filtered data into a state export default class ModifyPage_Single extends React.Component { constructor(props) { super(props) this.state = {data:[],idd:" ...

issue with the boundary of an array pointer

Currently working with C programming and utilizing a library that allows for task creation with communication through messages. The data shared in these messages is represented by pointers to the desired information. Specifically, I am transmitting an arr ...

Converting a numeric value to a string in JavaScript involves using

How can I display the message below in the snippet? The minimum value is 0.00000001. Instead of The minimum value is 1e-8 var minValue = 0.00000001; var message = "The minimum value is " + minValue.toString(); ...

Java - evaluating lists of data values

String isoArray[] = {"020","784","004","028"}; if(!("020".equals(element[2]) || "784".equals(element[2]) || "004".equals(element[2]) || "028".equals(element[2]))){ country a = new country(element[4], element[5], element[7]); countr ...

What could be causing redux.props.reducer to return undefined?

I recently encountered an issue with my code. I have a function in the actions folder that successfully fetches a URL using axios. However, there seems to be a problem when trying to retrieve the data from the reducer. I have a mapStateToProps function set ...

Tips for automatically incorporating animation upon page initialization

I'm looking to add an automatic image effect when the page is loaded. I currently have this code in my js file: $(window).ready(function(){ $(pin).click(function(){ $("#pin01").show().animate({left: '650px'}); }) }); Here is the HTML wit ...

The element refuses to accept the appendChild method

I've created a tampermonkey script that generates certain elements and adds them to the page. The first element, named ControllerBG, is appended to an element with the id "motd". However, when I try to append a second element, nothing appears on the ...

What is the reason behind having to refresh my ReactJS page despite it being built with ReactJS?

I have developed a task management application where users can input notes that should automatically update the list below. However, I am facing an issue where the main home page does not display the updated todos from the database unless I manually refres ...

Why is it not possible to decrement array index while using a different array value in Java?

Exploring a simplified code for Insertion Sort in Java led me to a roadblock. Despite my attempts to condense the lines of code, I encountered an issue that prevented further reduction. My curiosity is piqued - Why can't this be done? Showcasing the ...

The Jquery flot plugin is failing to plot the graph accurately based on the specified date

I am currently working on plotting a graph using the jquery flot plugin with JSON data. Here is what I need to do: Upon page load, make an AJAX call to receive JSON data from the server. From the received JSON, add 'x' and & ...

Using AngularJS to retrieve JSON data with the HTTP module

I am a beginner in the world of angularjs and I need some guidance. Below is the code I have written: <!DOCTYPE HTML> <html ng-app="myapp"> <head> <meta charset="utf-8"> <title>Angularjs project</title> <script type= ...

Easy method to detect duplicates within an array of strings? (PHP)

My dilemma arises from having an array that contains values like $somearray = array('car','bike','legs,'car'). What I wish to achieve is identifying which values in the array are repeated and determining their respective ...

Change the status of embedded list

Recently, I made changes to my class structure: class Board { this.state = { lists : [{ id: 0, title: 'To Do', cards : [{id : 0}] }] } Now, I am facing an issue where I want to update ...

Efficiently styling table Spans with styled components in React

Can anyone help me with a frustrating CSS problem I'm facing? I am trying to render these tags as spans, but they are not separating properly as shown in the image below. They appear stuck together and I can't figure out why. I am using styled co ...

Is it possible to create a unique AJAX function for a button element within a table?

Using an ajax function, I am populating a table with data from a PHP file that returns JSON encoded data. Each row in the table includes data as well as three buttons for delete, edit, and save operations specific to that row. The issue arises when I atte ...

The PHP file is configured to solely return a single JSON object, specifically the most recent

When sending a GET request to my server, the .PHP file I've created is only returning the latest JSON object instead of the entire array. I suspect that the array is being overwritten rather than being added to, but my PHP skills are not very strong, ...

Tips for showing a different div in the chat window after submitting the form

My index html file features a chat window designed like this: https://i.sstatic.net/PPGoy.png Below the submit button is an area to input text. How can I hide or disable this section and enable it only after the form is filled and the submit button is cl ...

Angular - Eliminate objects from an array based on their index matching a value in a separate array

I am facing a challenge with an array of indices and an array of objects: let indices = [1,3,5] let objArray = [{name: "John"}, {name: "Jack"}, {name: "Steve"}, {name: "Margot"}, {name: "Tim" ...

Getting Your Redux Form Ready for Submission

I recently transformed my Redux form into a wizard with multiple subcomponents following the structure outlined here: However, I'm encountering difficulties when trying to integrate the form with my actions to submit the form data. Unlike the example ...

Could it be that the AmCharts Drillup feature is not fully integrated with AngularJS?

UPDATE: Check out this Plunker I created to better showcase the issue. There seems to be an issue with the Back link label in the chart not functioning as expected. I'm currently facing a challenge with the AmCharts Drillup function, which should a ...