I have this text:
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam,
quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse
cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non
proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam,
quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse
cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non
proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
I want in Sublime text 3, to select the lines that have "Lorem" without using the mouse.
Thank You, for the help.
Your text were pasted in one line in Sublime Text so i manually moved each sentence into a single line. Then I used this regex:
^.*\b(Lorem)\b.*
In the search function, getting this result:
Click for fullsize
Note that you will have to enable the Regular Expression in the bottom left corner.
Related
We use the latest version of tinyMCE.
We have the following text - example given - take care at the first letter after the end of a proposition:
lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
How can we scan the text and properly capitalise the first letter in the proposition/phrase?
I have an HTML code that I am processing with the Cheerio library, I need to delete the tag "http://www.example.com'> example " for the links that refer to a domain (in this case "http://www.example.com") but not the other links. In addition, in the case of the link label being deleted, the keyword that contains it must be maintained.
Example origin:
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
Example result:
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
Thank you!
I found the solution to my problem:
$('a').each(function() {
if ($(this).attr("href").indexOf('example.com') > -1) {
$(this).replaceWith($(this).html());
}
});
If I use the .remove() function it delete the complete tag, but with this solution it only delete the link tag that contains example.com in the href attr.
I hope this helps to other people with the same challence. ;)
It sounds like you want:
$('a[href*="www.example.com"]').remove()
or
$('a[href*="www.example.com"]').each((i, a) => $(a).replaceWith($(a).text()))
Im experimenting a little with responsive design and i noticed that if you zoom the page in the browser or with smaller screens the text extends behind and below the footer despite it being set absolute with bottom: 0;
Can anyone explain how to solve this?
body {
margin: 0;
}
footer {
width: 590px;
height: 100px;
border: 5px solid black;
position: absolute;
bottom: 0;
}
footer h1 {
height:0px;
margin-left: 25px;
}
h1 {
font-size: 50px;
}
p {
text-align: justify;
}
.container {
width: 600px;
padding: 30px;
}
<!DOCTYPE=html>
<html>
<head>
<link rel="stylesheet" type="text/css" href="test.css"/>
</head>
<body>
<div class="container">
<h1>heading</h1>
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
</p>
<footer>
<h1>footer</h1>
</footer>
</div>
</body>
</html>
As a programmer, I frequently find myself using text editors rather than proprietry editing tools (like word) to smudge out
blocks of text. But I and I'm sure many of you with OCD find it rather annoying when you need to edit a line above
what you've already written, causing a jutting line out from your nicely formatted lines. I have had no other solution to this
problem other than re-new-lining every single line thereafter to correct the margins.
for lack of a better definition: Is there a better way of reformatting blocks of text to a given line width. if possible by selection
as well?
possible scenario:
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam,
quis nostrud exercitation ullamco
laboris nisi ut aliquip ex ea commodo
consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.
Excepteur sint occaecat cupidatat non
proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
becomes:
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam,
quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse
cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non
proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
according to a predefined setting.
I am using sublime text 2.
I use Sublime Text 3, select text, go to Edit -> Wrap -> ...
hope that works in version 2
I'm looking for a single command to turn this:
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do
eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad
minim veniam, quis nostrud exercitation ullamco laboris nisi ut
aliquip ex ea commodo consequat. Duis aute irure dolor in
reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla
pariatur. Excepteur sint occaecat cupidatat non proident, sunt in
culpa qui officia deserunt mollit anim id est laborum. Ipsum dolor sit
amet, consectetur adipisicing elit. Duis aute irure dolor in
reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla
pariatur. Excepteur sint occaecat cupidatat non proident, sunt in
culpa qui officia deserunt mollit anim id est laborum.
into this:
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do
eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad
minim veniam, quis nostrud exercitation ullamco laboris nisi ut
aliquip ex ea commodo consequat. Duis aute irure dolor in
reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla
pariatur.
Excepteur sint occaecat cupidatat non proident, sunt in
culpa qui officia deserunt mollit anim id est laborum. Ipsum dolor sit
amet, consectetur adipisicing elit.
Duis aute irure dolor in
reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla
pariatur.
Excepteur sint occaecat cupidatat non proident, sunt in
culpa qui officia deserunt mollit anim id est laborum.
Any suggestions?
If it's wrapped, that means a paragraph is actually only ONE line, and you're actually adding a single blank line between lines. try:
:g/.\n\n\#!/norm o
It's explained here .
And if it's not wrapped (means there're many lines in ONE paragraph), I've no idea how to do it, either. But according to the explaination of that site, you can try to manage it by writing your own regex rules !
:%s/\.\s*\n\(\S\)/\.\r\r\1
Obtains the desired result with the given sample (which contains a pesky trailing space).
We search for a dot followed by zero or more whitespace characters (because of the pesky trailing space), followed by a newline, followed by a non-whitespace character that we capture.
We replace with a dot, followed by two newlines and the non-whitespace character that we captured earlier.
(edit)
The following substitution is more generic and suits your non-specified requirements:
it doesn't care about how each "paragraph" ends
it respects indenting as well
so…
:%s/\s*\n\(\s*\S\)/\r\r\1
If you want to normalize your buffer and remove indenting:
:%s/\s*\n\(\s*\)\(\S\)/\r\r\2
or, with less backslashes…
:%s/\v\s*\n(\s*)(\S)/\r\r\2