After pasting multiple lines from a website, using keep source formatting, how may I indent only one line, instead of all that were pasted?

0

The video following URL best shows the issue, and what I'm trying to do: https://streamable.com/otc5a

I'll try to go into detail of describing it.

I copied lines 4 lines of code from w3schools website (link).

<?php
$str = "<h1>Hello World!</h1>";
$newstr = filter_var($str, FILTER_SANITIZE_STRING);
echo $newstr;
?> 

I pasted it into MS Word as 'keep source formatting'. I'm trying to indent the two 3 middle statements (lines), that start with $str, $newstr, & echo.

Despite selecting and highlighting only one line, MS Word acts as if all 5 statement were selected, when I try to ident the selected statement.

I'm trying to make it look like the following:

<?php
     $str = "<h1>Hello World!</h1>";
     $newstr = filter_var($str, FILTER_SANITIZE_STRING);
     echo $newstr;
?> 

gimmegimme

Posted 2020-02-08T20:36:27.533

Reputation: 13

Unless you have a lot to format, paste as plain text, and then indent as you want, or create a Style to fit and apply the Style. – John – 2020-02-08T20:41:16.753

Answers

0

I also copy/pasted the sample from the website, and that body of text is one paragraph, with line breaks (or spaces, if formatting is not preserved) between each new line. Different indentations can only be applied to each line like you want if each one is a new paragraph, so you may need to separate it into distinct paragraphs.

Chris

Posted 2020-02-08T20:36:27.533

Reputation: 21