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.
devdocs/assets/javascripts/views/pages/mdn.coffee

16 lines
399 B

#= require views/pages/base
class app.views.MdnPage extends app.views.BasePage
@className: '_mdn'
LANGUAGE_REGEXP = /brush: ?(\w+)/
afterRender: ->
for el in @findAll 'pre[class^="brush"]'
language = el.className.match(LANGUAGE_REGEXP)[1]
.replace('html', 'markup')
.replace('js', 'javascript')
el.className = ''
@highlightCode el, language
return