1. Edit or Create a page

  2. Select the Insert button

  3. Select the View more button

  4. Find Custom Code Highlight for Confluence and click it

  5. Paste of type in the code you want to display

  6. Add a <highlight> tag before the start of code you want highlighted and a </highlight> closing tag at the end of any code you want highlighted

  7. Press Insert

  8. Your highlighted code will appear as below:

var reregisterWatcher = function () {
    self.watcher && self.watcher.close(); // clean up existing watcher if present
    self.watcher = fs.watch(DESCRIPTOR_FILENAME, {persistent: false}, function (event) {
        if (event === 'change' || <highlight>event === 'rename') {
            self.logger.info('Re-registering due to ' + DESCRIPTOR_FILENAME + ' change');</highlight>
            self.reloadDescriptor();
            self.register(true);

            if(self.config.validateDescriptor()) {
                <highlight>self.validateDescriptor();</highlight>
            }
        }
        // re-register after each change, intellij's "safe write" feature can break file watches
        reregisterWatcher();
    });
};