question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Newlines in `text` after 6.2.2

See original GitHub issue

Now if pass array to text, ites will be text.join() But how i can each error set in new string? errors.join('<br>') outputs <br> as text and errors.join("\n") not working 😦

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:13 (6 by maintainers)

github_iconTop GitHub Comments

2reactions
birjjcommented, Dec 20, 2016

@akarelas That would be the other option. The problems I personally have with that solution is that

  • There’s no super pretty solution. We’d have to manually convert specific characters (eg. < and > to &lt; and &gt;), which isn’t quite as pretty as letting the browser handle it.
  • Separation of concerns. SweetAlert2 isn’t intended to be an escape library. While it isn’t particularly difficult, I’d rather leave HTML escaping to something that’s intended for the purpose (eg. the browser), and not have to worry about it.
  • Relatively arbitrary formatting rules. If we’re going to be guessing at what the user wants (eg. by replacing \n with <br>), then we might as well also add logic for wrapping text paragraphs in paragraph tags, putting links in anchor tags, or whatever other formatting you’d expect people to want to use. It’s easier to just take the stance of “you give us what you want us to display, we display it”.

Again, it’s not particularly hard to implement, and as mentioned in my first comment the decision is ultimately up to @limonte, but I’d personally prefer not modifying text before it’s inserted.

1reaction
limontecommented, May 19, 2017
Read more comments on GitHub >

github_iconTop Results From Across the Web

How do I enter a "soft return" ("line break" or "newline ...
Go into Layout Mode · Right click on the text object · Select "Set Script Triggers..." · Select "OnObjectKeystroke" · Create a new...
Read more >
6. The -m (modifylinebreaks) switch — latexindent.pl 3.19.1 ...
As of Version 3.0, latexindent.pl has the -m switch, which permits latexindent.pl to modify line breaks, according to the specifications in the modifyLineBreaks ......
Read more >
UAX #14: Unicode Line Breaking Algorithm
A process that determines line breaks in Unicode text, and that purports to implement the Unicode Line Breaking Algorithm, shall do so in...
Read more >
line break after the word "proof" in proof environment - TeX
The proof must start on a new line after the word “Proof”. The word “Proof” and the first line have to be on...
Read more >
Line break in HTML with '\n' - Stack Overflow
10 Answers 10 · The <br> HTML element produces a line break in text (carriage-return). It is useful for writing a poem or...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found