import Component from '@ember/component';

export default Component.extend({
  rendered: '',
  didRender() {
    this._super(...arguments);
    this.$('pre > code').each(function() {
      window.Prism.highlightElement(this);
    });
    this.scrollToFragment();
  },

  scrollToFragment() {
    if (location.hash) {
      let anchor_id = location.hash.substr(1);
      document.getElementById(anchor_id).scrollIntoView();
    }
  },
});

import Component from '@ember/component';

export default Component.extend({
  rendered: '',

  didRender() {
    this._super(...arguments);

    this.element.querySelectorAll('pre > code').forEach(function(node) {
      window.Prism.highlightElement(node);
    });
  },
});

use native DOM instead of jQuery