summaryrefslogtreecommitdiffstats
path: root/packages/markdown/template-integration.js
blob: 301bde31d8bd316ea1e34dd1fecd300689125959 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
if (Package.ui) {
	var Template = Package.templating.Template;
	var UI = Package.ui.UI;
	var HTML = Package.htmljs.HTML;
	var Blaze = Package.blaze.Blaze; // implied by `ui`

	UI.registerHelper('markdown', new Template('markdown', function () {
		var self = this;
		var text = "";
		if(self.templateContentBlock) {
			text = Blaze._toText(self.templateContentBlock, HTML.TEXTMODE.STRING);
		}

		return HTML.Raw(Markdown(text));
	}));
}