import { EventHub } from '../event' ; export class Highlight { constructor ( eventHub ) { eventHub . listen ( 'container-changed' , this . handle ) ; } handle ( ) { if ( ! window . hljs ) return ; const { highlightBlock } = window . hljs ; const blocks = document . querySelectorAll ( 'pre' ) ; Array . from ( blocks ) . forEach ( code => highlightBlock ( code ) ) ; } }