I am using the dojo createText function to programmatically create a text object in Javascript. This functionality has been working well except for newline characters within the string. I would like for this functionality to be able to handle multiline text as well as single line text. For example:
var content = “Mercury\nVenus\nEarth\nMars”;
console.log(content);
surface.createText({x: 0, y: 0, text: content, align: “start”});
console.log shows this:
Mercury
Venus
Earth
Mars
Whereas createText draws this:
Mercury Venus Earth Mars
The behavior appears to be as if createText is replacing the newline character with a space character. Is there a syntax to get createText to draw the text visually as console.log does for multiline content? Or is the only option to split the string and use a separate createText for each?