Search code examples
jquerywarningssublimetext3eol

How to not have errors for bad EOL escaping jQuery


Currently I do this:

$appendedItems.append('\
    <li class="user_profile_card" style="'+newline+'">\
        <div class="line-structure-top"></div>\
        <div class="top-colour-section-tier2"></div>\
        ...
    </li>');

But sublime returns bad escaping of EOL errors / warnings. I could just ignore it, but hate seeing the warnings.

How should this be done correctly?


Solution

  • You could use string concatenation instead:

    $appendedItems.append('<li class="user_profile_card" style="' + newline + '">' +
        '<div class="line-structure-top"></div>' +
        '<div class="top-colour-section-tier2"></div>' +
    '</li>');