Syntax Highlighting for Google Gadgets

At Atlassian, we’ve been on the Google Gadgets gravy train for the past few months. Working with gadgets means you’ll be working a lot with HTML & JavaScript stuck in XML files. Since the IDE picks up the file as an XML file, you end up losing the syntax highlight sugar coating you know and love.

Luckily, for IDEA users in any case, there is a way! With IntelliLang you can “inject” a language within another language. You can configure IDEA to recognise text of <Content> tags in XML files as HTML. Simply hit “Command + 1” (quick fix) in the content block, select “Inject Language”, choose HTML and you’re done. You can tweak the configuration (e.g. you accidentally selected JavaScript rather than HTML) through the “Settings” menu.

Now you should have full HTML, CSS & JavaScript recognised by IDEA in your little Content block. IDEA seems to take a second or so reparsing the file, but you do get the usual autocomplete, highlighting goodness.

Published

in

Related Content

More in ‘
Featured Article
Announcing social enterprise discounts: Atlassian tools for social impact teams
Featured Article
Great managers meet uncertainty with curiosity and confidence
Featured Article
Introducing Databricks Query Runner: Transforming data into insight
Featured Article
Team ’25 Europe: AI that’s changing the game for teams

More Collections

Meet Rovo everywhere: AI that connects every app, every team, every workflow

Introducing Atlassian Software Collection

Move Faster and Work Smarter with Atlassian’s AI-Powered Teamwork Collection