Custom HTML tags

I have a javascript library that parses some custom HTML tags and would like to augment the Webstorm code completion to include these new HTML tags. Could someone point me in the right direction for this?

If it helps. The file extension is ".html" but there is NO root tag "<HTML>" or otherwise. Just an html fragment.

Thanks.

5 comments
Comment actions Permalink

I have modifiesd an HTML 5 DTD and added my custom tags. And loaded it into the Schemas and DTDs. I'm not sure how to link it or force a specific extension to validate against it?

0
Comment actions Permalink

I think I got this working. (A start anyway.)

I used the html5 dtd from https://github.com/Komodo/KomodoEdit/tree/master/contrib/catalogs/html5  (I needed all the files in the directory, but only made changes to the html5.dtd file.) Also teh FrameTarget definition is missing a closing parenthese. (<!ENTITY % FrameTarget "(_blank | _parent | _self | _top">)

I used this perl script http://www.w3.org/2000/04/schema_hack/ to generate and xsd file. I had to add a <?xml version="1.0" ?> line to the front of the file, however.

I added a reference to the external schemas and dtds (help page: https://www.jetbrains.com/idea/help/schemas-and-dtds.html) using the filename as the uri. (in my case html5x.xsd)

I then changed the default html language level (same help page) to html5x.xsd (matching the external reference name.) This did not work without the .xsd in both places.

0
Comment actions Permalink

I think you may have overlooked the obvious.  I use PhpStorm, but from what I can tell, they are nearly identical.

So let me get this straight.  You just want to add Custom HTML tags to the editor?  For code hinting, and template generation?  If so, then why not use Settings >> File and Code Templates? Or Settings >> Live Templates?  With the File and Code Templates, you can create a new template with all the DTD and page requirements you need.  In the Live Templates, you add code hinting for new tags by clicking the + sign, on the right.

Sorry if I misunderstood what you need, or are looking for.

Regards,

Sven2157

0
Comment actions Permalink

Thanks Sven, I'll try that out.

0
Comment actions Permalink

So Landon,

Did that do the trick?

0

Please sign in to leave a comment.