mirror of
https://github.com/discourse/discourse.git
synced 2024-11-30 04:34:13 -06:00
FIX: Don't surround oneboxes by paragraphs
This commit is contained in:
parent
7ab98bb0e7
commit
914f0c3512
@ -101,6 +101,14 @@ function parseTree(tree, path, insideCounts) {
|
||||
|
||||
insideCounts[tagName] = insideCounts[tagName] - 1;
|
||||
}
|
||||
|
||||
// If raw nodes are in paragraphs, pull them up
|
||||
if (tree.length === 2 && tree[0] === 'p' && tree[1] instanceof Array && tree[1][0] === "__RAW") {
|
||||
var text = tree[1][1];
|
||||
tree[0] = "__RAW";
|
||||
tree[1] = text;
|
||||
}
|
||||
|
||||
path.pop();
|
||||
}
|
||||
return tree;
|
||||
@ -149,9 +157,6 @@ Discourse.Dialect = {
|
||||
var tree = parser.toHTMLTree(text, 'Discourse'),
|
||||
result = parser.renderJsonML(parseTree(tree));
|
||||
|
||||
// This feature is largely for MDTest. We prefer to strip comments
|
||||
// in Discourse
|
||||
|
||||
if (opts.sanitize) {
|
||||
result = Discourse.Markdown.sanitize(result);
|
||||
} else if (opts.sanitizerFunction) {
|
||||
|
Loading…
Reference in New Issue
Block a user