import hljs from 'highlight.js/lib/core'
import 'highlight.js/styles/github.css';
import javascript from 'highlight.js/lib/languages/javascript';
import json from 'highlight.js/lib/languages/json';
hljs.registerLanguage('javascript', javascript);
hljs.registerLanguage('json', json);

export function highlightHtml(htmlStr, language) {
  return hljs.highlight(htmlStr, {
    language:
      language
  }).value
}