Fix: block parser now uses regexes for end tags. solves code block case, where end tag must be on a line of its own.

This commit is contained in:
Jens Maier
2014-08-14 01:58:01 +02:00
parent 5caf72510c
commit 23002ae01c
5 changed files with 21 additions and 14 deletions
@@ -21,7 +21,7 @@ function flattenBlocks(blocks) {
Discourse.Dialect.replaceBlock({
start: /^`{3}([^\n\[\]]+)?\n?([\s\S]*)?/gm,
stop: '```',
stop: /^```$/gm,
emitter: function(blockContents, matches) {
var klass = Discourse.SiteSettings.default_code_lang;
@@ -54,7 +54,7 @@ Discourse.Dialect.on('parseNode', function (event) {
Discourse.Dialect.replaceBlock({
start: /(<pre[^\>]*\>)([\s\S]*)/igm,
stop: '</pre>',
stop: /<\/pre>/igm,
rawContents: true,
skipIfTradtionalLinebreaks: true,