0

I've created the following snippet on sublime text:

<snippet>
<content><!DOCTYPE html>
<html>
<head>
    <meta charset='UTF-8'>
    <title>Document</title>
</head>
<body>

</body>
</html></content>
<tabTrigger>!</tabTrigger>
</snippet>

But when attempting to save it, I get the following error:

"error parsing snippet xml: unexpected end of data in file"

Why is this?

Yours sincerely and thank you for all your help.

1 Answer 1

2

You may have accidentally removed the <![CDATA[ and ]] portions of the sample snippet XML; as a result sublime can't figure out where the content of the snippet ends.

You want something more like this:

<snippet>
    <content><![CDATA[
<!DOCTYPE html>
<html>
<head>
    <meta charset='UTF-8'>
    <title>Document</title>
</head>
<body>
    $0
</body>
</html>]]></content>
    <tabTrigger>!</tabTrigger>
</snippet>

Note that I've added a $0 into the snippet inside the body tags; that tells Sublime where to drop the cursor after it has expanded the snippet, so that you're ready to continue editing the HTML document; you may or may not want to have that depending on what you're trying to do.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.