Skip to content

Instantly share code, notes, and snippets.

@vojtajina
Created October 12, 2010 21:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vojtajina/622956 to your computer and use it in GitHub Desktop.
Save vojtajina/622956 to your computer and use it in GitHub Desktop.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html xmlns:ng="http://angularjs.org">
<head>
<script type="text/javascript" src="../angular.js/src/angular-bootstrap.js" ng:autobind></script>
</head>
<body>
<script type="text/javascript">
angular.markup('---', function(text, textNode, parentElement) {
var compiler = this;
var index = text.indexOf('---');
if (index > -1) {
var before = compiler.text(text.substring(0, index));
var hr = compiler.element('hr');
var after = compiler.text(text.substring(index + 3));
textNode.after(after);
textNode.after(hr);
textNode.after(before);
textNode.remove();
}
});
</script>
{{1+3}}
xxx
---
xxx
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment