How to use the highlight.js.highlightBlock function in highlight

To help you get started, we’ve selected a few highlight examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github heyui / heyui / doc / js / vuehighlight.js View on Github external
componentUpdated: function componentUpdated(el, binding) {
      // after an update, re-fill the content and then highlight
      const targets = el.querySelectorAll('code');

      for (let i = 0; i < targets.length; i += 1) {
        const target = targets[i];
        if (binding.value) {
          target.textContent = binding.value;
          hljs.highlightBlock(target);
        }
      }
    }
  });
github gentics / gentics-ui-core / src / docs / components / highlighted-code / highlighted-code.component.ts View on Github external
ngAfterViewInit(): void {
        let codeEl = this.elementRef.nativeElement.querySelector('code');
        hljs.highlightBlock(codeEl);
    }
github ketchuphq / ketchup / admin / src / js / pages / template.ts View on Github external
], (require) => {
      let hljs: any = require('highlight.js');
      require('highlight.js/lib/languages/xml');
      require('highlight.js/styles/rainbow.css');
      hljs.highlightBlock(el);
    }, 'hljs');
  }
github artisonian / erudite / src / renderer.js View on Github external
function highlight () {
  for (let block of ui.markdownBody.querySelectorAll('pre code')) {
    hljs.highlightBlock(block);
  }
}

highlight

Highlight code syntax with node.js

Unrecognized
Latest version published 9 years ago

Package Health Score

48 / 100
Full package analysis