Working on a directive to highlight <code> tags that are being outputted by a directive to render <markdown> tags.
The problem is that the <code> directive is never hit after the <markdown> directive runs. However the <code> directive runs on code tags that are not outputted from the <markdown> directive.
The Markdown directive
angular.module('App').directive "markdown", ->
converter = new Showdown.converter()
scope: true
restrict: 'E'
link: (scope, element, attrs) ->
if attrs.markdown
scope.$watch attrs.markdown, (newVal) ->
html = converter.makeHtml(newVal)
element.html(html)
else
redraw = ->
html = converter.makeHtml(element.text())
element.html(html)
#### expecting the code directive to be trigger after this.
scope.$on "$includeContentLoaded", redraw
redraw()
Any thoughts?