You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

16 lines
555 B

  1. import cash from 'cash-dom'
  2. import _ from 'lodash'
  3. export default {
  4. format () {
  5. for (let i = 1; i < 6; i++) {
  6. cash(`.editor-markdown-preview-content h${i}.tabset`).each((idx, elm) => {
  7. elm.innerHTML = 'Tabset ( rendered upon saving )'
  8. cash(elm).nextUntil(_.times(i, t => `h${t + 1}`).join(', '), `h${i + 1}`).each((hidx, hd) => {
  9. hd.classList.add('tabset-header')
  10. cash(hd).nextUntil(_.times(i + 1, t => `h${t + 1}`).join(', ')).wrapAll('<div class="tabset-content"></div>')
  11. })
  12. })
  13. }
  14. }
  15. }