line-breaks

XSLT output formatting: keep line breaks, remove indent

那年仲夏 提交于 2019-12-04 06:34:14
问题 Here's my XML: <doc> <article> <texte> <notes>-</notes> <content> <title>T 1</title> <argument>Arg 1</argument> <p>Paragraph 1.1</p> <p>Paragraph 1.2</p> <p>Paragraph <i>1.3</i></p> <short-author>FB</short-author> </content> <notes>-</notes> <content> <title>T2</title> <p>Paragraph 2.1</p> <short-author>JD</short-author> </content> <notes>-</notes> <content> <title>T3</title> <argument>Arg 3</argument> <p>Paragraph 3.1</p> <short-author>NC</short-author> </content> </texte> </article> </doc>

Break string with line breaks into HTML paragraphs with PHP

半腔热情 提交于 2019-12-04 05:58:50
I'm getting text from my MySQL database which is broken into lines (paragraphs). It's stored in the variable $post_data['content'] . How do I make it print out with the line breaks? The code I'm currently using: $post_data['content'] = explode("\n", $post_data['content']); $post = "<p>" . implode("</p><p>", array_values($post_data['content'])) . "</p>"; This doesn't work to the extent I want it to. If I have text like this in the database: line 1 paragraph 1, line 2 paragraph 1. line 3 paragraph 2, line 4 paragraph 2, line 5 paragraph 2. The code would display like this (which I don't want):

asp.net: line break \\n in resource .resx file does not work

喜欢而已 提交于 2019-12-04 05:25:23
The "\n" does not work in below code, it's just displayed as "\n" if (!window.confirm(XXXXX.Globalization.LocalResource.InvalidUrl)) { return false; } the string is "Invalid URL! \n Are you sure you want to continue?" in resource resx file. how to make it work? Try shift-enter to create a new line in the designer. Alternatively copy and paste the result from notepad. Another way is to edit the RESX xml manually. The problem is that the RESX designer UI will auto-escape the strings. So your value is actually: "Invalid URL! \\n Are you sure you want to continue?" What worked in my case was this:

Avoid breaking line between two words when resizing [duplicate]

眉间皱痕 提交于 2019-12-04 02:55:06
This question already has an answer here: Can I stop two words from breaking onto separate lines and creating an orphan? 3 answers I have a string and I need it not to break two specific words in different lines. Example: "Ask for it it when contracting until 2016/09/30 with T-2 Rate" When I resize window and make it smaller there is a moment that it outputs: "Ask for it it when contracting until 2016/09/30 with T-2 \n Rate" I would like T-2 + Rate to be always together. How to do it? T.J. Crowder You use a nonbreaking space . The HTML entity for it is   . You'll probably want a non-breaking

Importing CSV that has line breaks within the actual fields

浪尽此生 提交于 2019-12-04 02:24:56
I am using PHP to import a CSV file, which originates from an excel spreadsheet. Some of the fields contain line breaks in them, so when I reopen the csv in excel / open office spreadsheet, it misinterprets where the line breaks should happen. Also in my script, using fgetcsv to go through each line, it is incorrectly line breaking where it shouldn't be. I could manually cleanse the data but a) that would take ages as its a 10k line file, and b) the data is exported from a clients existing piece of software Any ideas on how to automatically solve this on the import process? I would have

Multi line text inputs in shiny

泄露秘密 提交于 2019-12-04 00:47:49
What are my options to realize text inputs with multiple lines/line breaks (either explicit or just soft-wraps for nicer output in the UI) in shiny? I'd like to implement an app that has a description/details field and the content being entered will most likely be more than just one line. Basically, I'm looking for something to realize a similar functionality of the very text input box of stackoverflow I'm writing this question in: line breaks, scroll bar and/or (auto-)adjustment of height. Example # UI --------------------------------------------------------------------- ui <- fluidPage( p(),

Line break inside HTML tag attribute value

佐手、 提交于 2019-12-04 00:41:36
How can I insert line breaks inside HTML attribute values, like this: <href="mailto:info@example.com?subject=TestMail&body=Please enter the following details. Name Email Mob No"> When the user replies, the body part should display as below: Please enter the following details. 1. Name 2. Email 3. Mob No I tried using <br> tags, but they get displayed. The line break should be URL encoded into %0D%0A Your mailto will look like: <a href="mailto:xxx@example.com?subject&body=1.Name%0D%0A2.Email">mailme</a> Info from http://www.cubetoon.com/2008/how-to-enter-line-break-into-mailto-body-command/ 来源:

Avoid line breaks when using out-file

回眸只為那壹抹淺笑 提交于 2019-12-03 23:32:08
问题 I'm getting a little frustrated on a little PowerShell script I'm writing. Basically I loop through text files to check every line against an array of regular expression patterns. The result gets piped to the out-file cmdlet which appends it to another text file. Get-ChildItem $logdir -Recurse -Include @('*.txt') | Get-Content | ForEach-Object { Select-String $patterns -InputObject $_ | Out-File $csvpath -Append -Width 1000 } My problem is that I can't get out-file to omit those additional

Newline in a ValidationMessage

守給你的承諾、 提交于 2019-12-03 16:36:42
问题 I'm testing a list of things for null. Every time I find one, I save it in an array to implement it in a validationmessage. Output I want looks like this: Field 1 is required Field 4 is required etc... But I can't seem to be able to start a new line. Now, it looks like this: Field 1 is required Field 4 is required Does anybody know how to achieve this? EDIT: controller: IDictionary<int, String> emptyFields = new Dictionary<int, String>(); foreach (Something thing in AnotherThing.Collection) {

convert breaks and paragraph breaks into new line in java

泄露秘密 提交于 2019-12-03 15:57:45
Basically I have an HTML fragment with <br> and <p></p> inside. I was able to remove all the HTML tags but doing so leaves the text in a bad format. I want something like nl2br() in PHP except reverse the input and output and also takes into account <p> tags. is there a library for it in Java? You basically need to replace each <br> with \n and each <p> with \n\n . So, at the points where you succeed to remove them, you need to insert the \n and \n\n respectively. Here's a kickoff example with help of the Jsoup HTML parser (the HTML example is intentionally written that way so that it's hard