FAQ Database Discussion Community


textarea content inside a .txt file but keep line-breaks

javascript,html,textarea,line-breaks
I have some piece of code that saves value of textarea into a local text file. Everything is seems to work fine but I don't want to lose line breaks. Code & fiddle: HTML <textarea id="textbox">Type something here</textarea> <button id="create">Create file</button> <a download="info.txt" id="downloadlink" style="display:none">Download</a> JS (function () { var...

When hover at an image, will reduce the opacity and add text

jquery,hover,opacity,line-breaks
As can see at jsfiddle, When hover at the image, opacity of the image will reduce and text will be added to it. http://jsfiddle.net/tangjeen/QPW27/12/ I am having problem here. Any help will be greatly appreciated. When I hover over the image, the image does not appear to be stable, the...

Remove line breaks “\n” in R

r,date,line-breaks,data-type-conversion,factors
I have been trying to remove the line breaks from a data set in R. All the columns are factors hence before i could replace the "\n" with "NA", i need to change the data type from factor to character or Date. I am mentioning my code and a sample...

Markdown no break (nobr)?

html,markdown,line-breaks
I've got a phone number in my markdown that tends to break over the end of the line. In HTML I could wrap it in a <nobr> tag to have it keep together properly. What is the correct way to do this in markdown?

Putting line breaks in text within a PHP array

php,arrays,line-breaks
I have an array with a bunch of youtube video data that I call in a php file and populate a page. Basically in the array I have a lot of text ie a description of the video that I want to have line breaks. Basically when I make this...

Checking if a string begins with integer after line breaks [duplicate]

java,regex,string,line-breaks
This question already has an answer here: How to remove multiple line breaks from a string 1 answer I'm using Apache POI to read in from a .doc file, as a result, I have an arraylist of strings containing large amounts of line breaks, and tabs, from the original...

OR Query mongodb from java with “like” and “line break” and “case insensitive” at the same time

java,mongodb,like,line-breaks,case-insensitive
This is sample of one document in my mongodb collection page_link_titles: { "_id" : ObjectId("553b11f30b81511d64152416"), "id" : 36470831, "linkTitles" : [ "Syrian civil war", "Damascus", "Geographic coordinate system", "Bashar al-Assad", "Al Jazeera English", "Free Syrian Army", ... "February 2012 Aleppo bombings", "2012 Deir ez-Zor bombing", "Aleppo University bombings" ] }...

Adding line breaks and indents to XmlDocument

.net,line-breaks,xmldocument
What is the right way of adding line breaks and indents when building an XmlDocument to make its output (called by xmlDocoment->DocumentElement->OuterXml) look like this: <QualifyingProperties Target="#SignatureElem_0" xmlns="http://uri.etsi.org/01903/v1.3.2#"> <SignedProperties Id="SignedPropertiesElem_0"> This is the way I build my XmlDocument: XmlDocument^ xmlDoc = gcnew XmlDocument(); xmlDoc->PreserveWhitespace = true; XmlNode^ nQualifyingProperties = xmlDoc->CreateNode(XmlNodeType::Element,...

FOP, xsl-fo: disable line break

pdf-generation,line-breaks,xsl-fo,fop,apache-fop
With xsl-fo, I want to generate a pdf-file. The text for the pdf-file is a simple ongoing plain-text without any line-breaks in it. When I generate the pdf, there are line-breaks in the pdf, so after copying the text into Notepad, there are those line breaks, too. What I want...

Custom URL scheme to open text in whatsapp from mobile browser, newline / line break not working

javascript,android,html,jquery-mobile,line-breaks
I am using the following code: (jquery) window.open("whatsapp://send?text=Hello World!") To open and share a message from the mobile browser, this documentation can be found here: https://www.whatsapp.com/faq/android/28000012 However, I'd like to add a 'newline' somewhere in the message. I tried: \n <br> <br/> &lt;br&gt; in the message but these do not...

Unexpected Line Breaks in Output

c++,c++11,line-breaks,cout,extraction-operator
In this answer I have the following code: #include <iostream> #include <vector> #include <string> #include <sstream> #include <iterator> #include <limits> using namespace std; struct station{ string _stationName; int _studentPass; int _adultPass; }; std::istream& operator>>(std::istream& is, station& rhs){ getline(is, rhs._stationName, ';'); is >> rhs._studentPass >> rhs._adultPass; return is; } int main(){...

How to make yattag source better formatted?

html,python-3.x,line-breaks
I'm using yattag to generate HTML: doc, tag, text = Doc().tagtext() with tag("p"): text("My paragraph.") While it works well enough, when I look at the HTML source it comes out all on one line. Is there some kind of switch or other trick that makes yattag create more readable source?...

How to make a line break on the Python ternary operator?

python,line-breaks
Sometimes a line containing a ternary operator in Python gets too long: answer = 'Ten for that? You must be mad!' if does_not_haggle(brian) else "It's worth ten if it's worth a shekel." Is there a recommended way to make a line break at 79 characters with a ternary operator? I...

How To Remove All Text Before a Specific Value in a String

javascript,jquery,string,line-breaks
I have the following string, "blahblahhellothere", that I would like to be shortened to "hellothere" using JavaScript and/or JQuery. I have tried using the following code: var titletext123 = "blahblah<br>hellothere" var injuryt3xt = titletext123.substring(titletext123.indexOf("<br>") +1); Which only returns "br>hellothere". Does anyone have any code which will get rid of the...

Regex in c# that could either match new line or ignore it

c#,regex,line-breaks
Relatively new to Regular expressions in c#. Struggling to get this right. Requirement: Input string format : Some random text XXXX caused disturbance of XXXX hours of rework. Due to some random text reported in XXXX I needed to fetch all the 3 XXXX from the input. Concrete example: Complaint...

Ruby: Convert
to newline URI encode

ruby-on-rails,ruby,line-breaks,whatsapp,uriencoding
I want to share sometext on whatsapp so I'm converting html to text otherwise it displays all the tags. Currently I'm using strip_tags to remove tags but that also removes breaks from the text. How do I convert html to text and convert breaks to newline characters and url encode...

Showing line breaks if text contains '13' and '10'

html,css,line-breaks
Webapi returns custom text string with 13 and 10 characters for line. If I show this custom text in html, I do not see line breaks (if I use <pre> tag, then line breaks are shown). What should be modified in html or css to show linebreaks? I cannot modify...

JavaScript destroys all children after I append a break?

javascript,line-breaks,appendchild
I'm creating a script that takes two input dimensions, width, and height, and creates a scaled grid which is representative of how many blocks could fit in a box with the given dimensions with the following function: function makeRow() { for (var i = 1; i <= blocksTall; i++) {...

Create Linebreak on webpage within a textnode - Javascript

javascript,html,line-breaks,createtextnode
I've seen a few responses to this question but the suggestions did not solve my output issue. A form takes input and prints to the webpage like so: function init() { var div = document.createElement("div"); div.id = "output"; var name = document.getElementById("name").value; name.type = "text"; var address = document.getElementById("address").value; address.type...

Send a text/plain email and prevent Outlook from collapsing lines

email,outlook,line-breaks
I send out plain text mails from my web application (e.g. password reset); I'm pretty sure I use proper CRLF line endings all over both header and text. Some lines can be longer than 78 characters, but none more than 998+2. For some mails, Outlook mail clients collapse the whitespace...

Language design: end of statement linebreaks

line-breaks,language-design,semicolon
Well the title might be a bit misleading please correct me if you can bring the title better to the point. So, I'm currently experimenting with a programming language. I defined the basic syntax and wrote a pretty simple parser some months ago. Today I wanted to continue the project,...

Understand Error in Perl script

perl,csv,line-breaks
I'm trying to write a Perl script that convert the line endings of some CSV files stored in a folder. I am a Perl newbie so any help would be appreciated. use strict; use warnings; my @files = glob "*.csv"; foreach my $i (@files) { system('perl -i.bak -pe "s/\R/\n/g" '.$i.'')...

Inserting new lines into innerHTML output

javascript,html,tags,newline,line-breaks
If I were to have a string for a variable be var text = "Hello World!" and I wanted to place a new line after the word Hello, I know I can just create a new variable var b = text.replace(" ", "\n"); and console.log(b) will show the text in...

Bootstrap Grid Responsive break row

css,twitter-bootstrap,grid,line-breaks,dynamic-columns
I'm currently working with bootstrap grid system and got the following problem: I got components that stack together in 4 columns when > tablet. and in 2 columns when < tablet. Some of the components are with Links and some without. <div class="col-xs-6 col-md-3"> <p><img src="http://www.photoshopbuzz.com/wp-content/uploads/2011/11/red-stitch-icon-122-bebo.png" alt="" title="" class="easy-icon" /></p>...

TextWrangler - replace every second line-break with comma

text,grep,line-breaks,textwrangler
I have a text file containing only text lines like this: abcdefg 2009 hijklmnop 2012 I want to replace every second line-break with a comma. So it should look like this: abcdefg, 2009 hijklmnop, 2012 How can I do this in TextWrangler?...

Regular expression? How to break lines in Notepad++

regex,notepad++,line-breaks,long-lines
I'm translating an ugly formatted lang file of a plugin. It's really uncomfortable as it has no line breaks at all. How do I enter \n after } and most of all after "text":"text", Example of what the code looks like: {"dir":"ltr","editor":"Rich Text Editor","common":{"......... I'm new to regex and find...