div ignore start spaces and more then 1 space [duplicate] - html

This question already has answers here:
How to show the text with Line Breaks
(6 answers)
Closed 5 years ago.
the problem is that every space char at the start of the text is being discarded and every second space char afterwards is being discarded as well.
this is the example, treat every '_' char as "space" because it happening here as well:
text : "____a_a__a_______a"
visual : "a a a a"
the part of the angular 2 code that rendering the text is this:
<div #refId class = 'line_counter' [ngStyle]=setStyles()>
{{getData()}}
</div>
the solution i thought of is using some predefined char and render it as transparent but im really hopping that some one could help me with a real solution?

You cannot perform blank spaces inside the IDE and expect to visual it while running.
You must add &nbsp to your text value, this way you will be able to see it.

You can use this HTML entity:
this stands for "non-breaking space", and you can put as many after each other as you like.

Related

how to display specific number of letters of paragraph in HTML [duplicate]

This question already has answers here:
How can I set a character limit for paragraph?
(2 answers)
Closed 16 days ago.
I'm looking for solution to shortening paragraph in HTML
Let's say I have a paragraph
<p>This is some text</p>
Now what I want to know is how can I make this paragraph show less lines. For example instead of showing full paragraph it shows only first 4 characters which results in
<p>This</p>
I think you're looking for something like this: https://jedfoster.com/Readmore.js/
If you wanted to do it manually just store the text in globably js variable like:
var pText = "Some really long text that you want to shorten or lengthen on a click";
$(".showMore").toggle(function() {
//full text case
$(".myParagraphElement").html(pText);
// collapsed case, replace 50 with the number of characters you want
$(".myParagraphElement").html(pText.substring(50));
});

PhpStorm first line doesn't follow "Align consecutive assignments" setting

I have a little question while you having a break from coding.
I have set the "Align consecutive assignments" in PhpStorm.
For some reason sometimes the first line of a variable definition block is a little bit unaligned. Screenshot attached.
Basically my question is: Why is the = sign of the first line not aligned with all the following lines which are properly aligned after reformat.

How can I make spaces after numbers stay in place in HTML? [duplicate]

This question already has answers here:
How to put spaces between text in html?
(6 answers)
Closed 2 years ago.
I am having an issue with double spaces after dotted numbers as follows.
Suppose I put the following text in HTML, I get a space issue.
1. Box 1
The output should be:
Box 1
However, I get the following:
Box 1
Even when using margins, I get the same problem.
An actual example is below.
In Word:Permanent deletion:
Click on the drop-down menu that displays, ‘Keep in Inbox’.
Click on, ‘Discard’, on the menu.
In HTML:
Permanent deletion:
Click on the drop-down menu that displays, ‘Keep in Inbox’.
Click on, ‘Discard’, on the menu.
Same text but in HTML.
How can I retain the second space after the number for each instance?
If you want more than one space in html, you need to use the non-breaking space character entity

Notepad++ - is there a way to control the word separators [duplicate]

This question already has answers here:
notepad++ select hyphenated text
(7 answers)
Closed 7 years ago.
In Notepad++ (beloved) I could not helped but notice that the ctrl+left (SCI_WORDRIGHT) would jump on the next - signs.
Example:
WORD-ID-1 (is actually 3 words, WORD, ID , 1) vs. WORD_ID_1 is one word.
I am looking for setting to control that behavior.
Is there a way to define the white space what would control the SCI_WORDRIGHT/LEFT behavior?
The answer from Damien Plumettaz on question "notepad++ select hyphenated text" totally works for me.

Same tab space on Sublime/Notepad++ [duplicate]

This question already has answers here:
Sublime text: Merge multiple adjacent white spaces into one
(2 answers)
Closed 6 years ago.
Imagine this sentence:
I---like-java.
I want to ident this setence using sublime or notepad++ to:
I-like-java.
Edit:
- stands for an empty space
With Notepad++, you can do:
Find what: -{2,}
Replace with: -
This will replace two or more dash with only one.
Update after question edit:
In order to remove multiple spaces, just do the same as above by exchanging dash with space:
Find what: \h{2,}
Replace with: Just one space
Where \h means any horizontal space.