0

I am trying to print a screenshot from the OpenCPU, which returns everything in a group and does not accept the line breaks.

When using console.log() I get the open cpc url with the perfect line breaks, but in the index I get out

This is my code;

function (data) {
    var statResultsLink = resultsUrlPrefix + data.toString().match(/.+\/stdout/m),
    chartLink = resultsUrlPrefix + data.toString().match(/.+\/graphics\/[1]/m);

    // Add statistical (textual) results to results div
    $('#results').append("<br/>");
    $('<div/>', {
        id: 'statResults'
    }).appendTo('#results');

    $(document).ready(function() {                                 
        $("#statResults").load(statResultsLink);
    });

    // Add charts results to results div
    $('#results').append("<br/>");
    $('<img/>', {
        id: 'chartResults',
        src: chartLink
    }).appendTo('#results');
}
buræquete
  • 14,226
  • 4
  • 44
  • 89

1 Answers1

0

You could add a pre code tags to your text div to automagically break the R output