• Stars
    star
    110
  • Rank 316,770 (Top 7 %)
  • Language
    JavaScript
  • License
    MIT License
  • Created almost 12 years ago
  • Updated over 9 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Figure out when your HTML is busted

Tecate.js

Writing HTML is hard. Let's go shopping

Usage

You have an HTML file and you want to check if you made a mistake writing the HTML tags. Drop tecate.js into the <head> of your HTML document, like this:

<!doctype html>
<html>
    <head>
        <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
        <script type="text/javascript" src="https://raw.github.com/kevinburke/tecate/master/tecate.js"></script>
        <!-- ... more files in the head ... -->
    </head>
    <body>
    <!-- ... the body content ... -->
    </body>
</html>

Then if there's a problem with your HTML, you'll start getting nice error messages, like this:

error message

But you shouldn't put Javascript in the <head>

I agree. The problem is if you load the tecate.js file after, say, an unclosed link tag:

<a href="foo
<script src="tecate.js"></script>

It won't load properly and you'll never get the message telling you it didn't load! That's why I recommend putting tecate.js in the <head> of your HTML file.

Catching Bugs

Tecate will display an error message straight to the page if you messed up your HTML. Here are some of the bugs it can catch for you:

Missing a Closing Bracket

Say you forgot to end a tag with a bracket, or closed it badly:

<div class="foo"
    Some text
</div>
Missing Equals Sign For Attribute
<div class"foo">
    Some text
</div>
Missing Opening or Closing Attribute Quotes

These are some of the most pernicious.

<div class=foo">
    <a href="blah>Some text</a>
</div>
Invalid Element Name

Say you mixed up your "m" and your "n":

<form class="foo">
    <imput type="text" />
</form>

Reporting Bugs

Please create a new issue here and I will take a look.

Guidelines

Tecate parses HTML with regex, which is never a good idea. Given the vast, wide array of ways this can fail, the aim of Tecate is that it's better to not warn you about errors than it is to erroneously warn about things that are actually okay.

More Repositories

1

hamms

Malformed servers to test your HTTP client
Python
1,218
star
2

doony

UI Improvements for Jenkins
JavaScript
970
star
3

nacl

Pure Go implementation of the NaCL set of API's
Go
540
star
4

ssh_config

Go parser for ssh_config files
Go
386
star
5

go-bindata

A small utility which generates Go code from any file. Useful for embedding binary data in a Go program.
Go
330
star
6

hulk

In-browser JSON editor
JavaScript
312
star
7

sshpass

Mirror of http://sourceforge.net/projects/sshpass/
Shell
199
star
8

hostsfile

go tool for working with /etc/hosts files
Go
131
star
9

rct

Creating cool coasters for Roller Coaster Tycoon
Go
124
star
10

customize-twitter-1.1

Add your own custom CSS to modify the Twitter Embeddable Widget
JavaScript
91
star
11

tss

Go port of moreutils/ts
Go
43
star
12

swish

Switch SSH settings between Github profiles
Go
38
star
13

travis

Command line client for interacting with Travis CI
Go
19
star
14

handlers

Useful HTTP middlewares
Go
19
star
15

gitopen

Open one of your remote URL's in your browser
Python
17
star
16

rest

Go REST helpers
Go
14
star
17

sll

Strip long lines from output
Go
14
star
18

multi-emailer

Send personalized email messages to multiple email accounts (e.g. City Council members)
Go
13
star
19

2013

Flat UI website redesign
HTML
12
star
20

differ

Go
12
star
21

read-mongo-logs

Tail Mongo database logs
Go
11
star
22

gitlab

Command line tool for waiting for Gitlab pipelines to complete
Go
11
star
23

ansible-go

Go
9
star
24

rct-rides

working with roller coaster tycoon saved ride format
Go
9
star
25

weirdfortune

the unix fortune program, now with weird twitter
Python
8
star
26

snapchat-friends

surprise, your friend network is public
Python
8
star
27

proto-make-example

Makefile
8
star
28

gobike

Go
6
star
29

ynab-go

YNAB Go Client, including a detailed age of money calculator
Go
6
star
30

write_mailmap

Easy generate an AUTHORS file from the Git commit history
Makefile
6
star
31

metrosolver

Finding optimal Mini Metro routes
6
star
32

google-oauth-handler

HTTP middleware for handling Google authentication
Go
5
star
33

targets

I am the next coming of John Carmack
C#
5
star
34

go-random-project-generator

Random project name generator (like Github or Heroku app names)
Go
5
star
35

twilio-jsonapi

A JSON convenience wrapper for the Twilio API
Python
4
star
36

godocdoc

Start godoc and open a HTTP server to the homepage
Go
4
star
37

isec2

Go library that reports whether you are running in EC2
Go
3
star
38

envdir

Go port of djb envdir
Go
3
star
39

vault-go

Better Hashicorp Vault client
Go
3
star
40

public-comments

I write letters to local governments and post them here
Go
3
star
41

clipper

API for retrieving Clipper Card data (and parsing Clipper Transactions)
Go
3
star
42

talks

Talks I give at conferences
3
star
43

goodmorningcmc

Python
2
star
44

circle-webhook

webhook server and JSON parser for circle ci webhooks
Go
2
star
45

gerrit-heroku

Attempting to run Gerrit on Heroku
Makefile
2
star
46

slides

Presentations
HTML
2
star
47

write_config_from_env

Pull env vars into a config file
Go
2
star
48

humanbench

Human-readable benchmark output
Go
2
star
49

tt

Better Node test runner
Go
2
star
50

jenkins

Open Jenkins urls from your command line
Python
2
star
51

haa

CA Housing Accountability Act Resources
2
star
52

stubhub-tickets

checking stubhub ticket prices
Python
2
star
53

tarbz2.com

Helping you remember which tar option to use.
ApacheConf
2
star
54

goose

Maintained fork of liamstask/goose that supports ALTER TYPE, CREATE INDEX CONCURRENTLY
Go
2
star
55

buildkite

Buildkite CLI tool
Go
2
star
56

chroma-markdown

Combined Markdown + syntax highlight HTML compiler
Go
2
star
57

gostdjs

The Go standard library, implemented in Javascript
JavaScript
1
star
58

old-county-road

JavaScript
1
star
59

generic-pool-timeout

JavaScript
1
star
60

oculus-rating-data

Working with Oculus rating data
Go
1
star
61

tarsnap-old-archives

Deleting old Tarsnap archives
Go
1
star
62

rustls-postgres

1
star
63

sample-html

sample html
1
star
64

local-servers

Making your local projects more browsable
Makefile
1
star
65

recompile

Concurrent recompilation of individual files (see README)
Go
1
star
66

Twilio-Python-quickstarts

Python quickstarts for Twilio
Python
1
star
67

flagr

Rearrange flags so the options come first
Go
1
star
68

delete-phone-numbers

Delete numbers from a Twilio account
Go
1
star
69

flot.selection.js

The Flot selection plugin, with draggable left/right edges
JavaScript
1
star
70

make

Go
1
star
71

javascript-ipython

ipython notebook for javascript
Shell
1
star
72

enable_pg_logs

Enable Postgres query logging
Go
1
star
73

ipv6-etc-hosts

Go
1
star
74

telapi-python

Tel API Python Helper Library
Python
1
star
75

lucifer

Hot, hot test reloading from Javascript
JavaScript
1
star
76

waterline-self-driving-car

1
star
77

newproject

1
star
78

bigtext

Go library to display text really big using Quicksilver on a Mac
Go
1
star
79

twilio_munischedule

Ruby
1
star