Просмотр исходного кода

support markdown-like emphasis.

Lucas Stadler лет назад: 12
Родитель
Сommit
12a94dbba7
1 измененных файлов с 9 добавлено и 0 удалено
  1. 9 0
      js/babl/public/index.html

+ 9 - 0
js/babl/public/index.html

73
					el.textContent = match[0];
73
					el.textContent = match[0];
74
					return el;
74
					return el;
75
				}
75
				}
76
			}, {
77
				re: /^(\*\*?|__?)([^\s]+)\1$/,
78
				fn: function(match) {
79
					var highlight = {"*": "em", "**": "strong", "_": "em", "__": "strong"};
80
					console.log(match.toString());
81
					var el = document.createElement(highlight[match[1]]);
82
					el.textContent = match[2];
83
					return el;
84
				}
76
			}, { re: /.*/, fn: function(match) { return new Text(match[0]); }}];
85
			}, { re: /.*/, fn: function(match) { return new Text(match[0]); }}];
77
86
78
			function expandWord(word) {
87
			function expandWord(word) {