copy & paste between excel and html editor - copy

Here's what happens when I copy from Excel to Dreamweaver or any editor Sublime Text,notepad. ...
I think the problem comes from Excel but not from my php code
To show you I copy directly from Dreamweaver or (Sublime Text,notepad) to Excel after I copy what I pasted into excel and I paste it in the html editor.
The result is double double quotes
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Document sans nom</title>
</head>
<body>
</body>
</html>
Paste from Excel to html editor
"<!doctype html>
<html>
<head>
<meta charset=""utf-8"">
<title>Document sans nom</title>
</head>
<body>
</body>
</html>
"
Where is the problem please?

Double quote is an escape character in Excel. Since you have multiline text in excel box it will add double quote at the beginning and end and add another double quote before all existing double quotes to escape it. And when you copy it copies with the quotes. Its not a problem with your HTML editor. You will have to search and replace all double double quotes with single double quotes.

Related

emmet force default cursor position after expansion

I am using following emmet snippet on VS Code:
{<!DOCTYPE html>}>html[lang='${lang}']>(head>meta[charset='${charset}']+meta[http-equiv='X-UA-Compatible'][content='IE=edge']+meta[name='viewport'][content='width=device-width,initial-scale=1.0']+(title>{${title}${1}})+script+style{.one{\}})+(body>div.one)
There is a tab stop after title title>{${title}${1}} which places the cursor by default after text title|. It expands like this:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width,initial-scale=1.0">
<title>title|</title>
<script></script>
<style>.one{}</style>
</head>
<body>
<div class="one"></div>
</body>
</html>
I want the cursor inside css class, in between curly braces, .one{|}.
So I put tab stop inside the class like .one{${1}\}}:
{<!DOCTYPE html>}>html[lang='${lang}']>(head>meta[charset='${charset}']+meta[http-equiv='X-UA-Compatible'][content='IE=edge']+meta[name='viewport'][content='width=device-width,initial-scale=1.0']+(title>{${title}})+script+style{.one{${1}\}})+(body>div.one)
But after expansion the curser is placed between script tag instead. <script>|</script>.
how can I get the curser to be inside .one{|} after expansion?
also, can I put line break inside text like .one{<linebreak>|<linebreak>}?
I can reproduce the same behaviour you are seeing in vscode. Note that if you tab once the cursor does go to where you want. It may be a bug.
If this form is something you use a lot consider making it into a snippet. It is a lot clearer to reason about and the tabstop placement does work as expected in vscode. And you get a linebreak wherever you make a new line, so a linebreak can go anywhere.
Example snippet:
"html9": {
"prefix": "html9", // whatever prefix you want
"body": [
"<!DOCTYPE html>", // need to escape "'s
"<html lang=\"en\">",
"<head>",
"\t<meta charset=\"UTF-8\">", // \t for a tab
"\t<meta http-equiv=\"X-UA-Compatible\" content=\"IE=edge\">",
"\t<meta name=\"viewport\" content=\"width=device-width,initial-scale=1.0\">",
"\t<title>title|</title>",
"\t<script></script>",
// "\t<style>.one{$1}</style>",
"\t<style>.$1{$2}</style>", // tabstop $1 for class name
"</head>",
"<body>",
// "\t<div class=\"one\"></div>",
"\t<div class=\"$1\"></div>", // tabstop $1 for class name
"</body>",
"</html>"
]
}
See Defining your own snippets.

VS Code weird pasting

I'm building my site with Hugo and I've noticed weird behavior of VS Code when pasting snippets of codes like:
the bug displayed
<link rel="stylesheet" href="{{ "css/style.css" | relURL }}">
The first line is typed by hand and it works, the second line is pasted, and as you can see VS Code treats this code differently and it doesn't work. It similar to this:
bug 2 displayed
<meta charset="utf-8">
It breaks the code and won't let the site to render. I have Format On Paste turned off. I'm pasting the snippets from a .epub ebook - Is there a way to paste without any format? Similar to what you can do in Google Docs (ctrl + shift + V)
They most likely are the quote characters that look like the ".
Just delete the characters and replace them with " and see if that fixes the problem.
Some e-books use a formatting tool meant to be used in novels and it replaces the " with the quote characters as if John says: ”BlaBlaBlaBla“
To better see the difference you might try and use a different font that has different glyphs for these quotes.
To replace the Double Quotation Marks (U201C and U201D) use extension Replace Rules
Add to settings.json
"replacerules.rules": {
"Quotes": {
"find": ["”", "“", "‘", "’"],
"replace": ["\"", "\"", "'", "'"]
}
}
Execute command: Replace Rules: Run Rule...
And select: Quotes
If you first select part of the file only those parts are searched and replaced.
If needed you can also replace the Double Prime (U2033 and U2036) characters. But I haven't seen any eBook that uses them.

Atom creating double angle brackets

Why does my Atom makes double brackets when I enter auto input on, I have installed packages for Atom.
double brackets
There is no need to type the brackets. Just type what you want to do, for example script and it will create the following code:
<script type="text/javascript">
</script>

Change HTML + Tab autocomplete (Sublime Text 2)

When you type out the word like so
and then press tab it autocompletes to something like so...
But I want it to look something more along the lines of this
This is one of Sublime's built in snippets. You can edit the default one or create a new one. To edit the existing,
Preferences > Browse Packages
Open HTML folder
Edit html.sublime-template
The default snippet is below:
<snippet>
<content><![CDATA[<html>
<head>
<title>$1</title>
</head>
<body>
$0
</body>
</html>]]></content>
<tabTrigger>html</tabTrigger>
<scope>text.html</scope>
</snippet>
The content you want to edit is between <![CDATA[ and ]]>. The $0 and $1 variables are placeholders for content and once Sublime Text renders the snippet, you can move between the placeholders by pressing tab.

markdown: HTML block level tags wrapped by <p>

I'm using markdown.pl downloaded from directly from Darring Fireball to translate .md files into html.
I start the file with some block level html, then followed by markdown syntax
<div class="header">title</div>
# header
markdown keeps wrap the <div> class with <p> tags, producing:
<p><div class="header">title</div></p>
<h1>header</h1>
If I start the file with a newline, before the html block level tag, an empty will be produced
<p></p>
<div class="header">title</div>
<h1>header</h1>
I want to know how to stop markdown from wrapping my block-level HTML tags with <p>s.
That code is not maintained because Gruber don't care. ¹ ²
Use Text-Markdown Markdown.pl instead, it works like you expect it to.