Revert "FEATURE: fenced code blocks can hint with "pre" or "text""
This reverts commit 943ad8d1d5
.
This commit is contained in:
parent
19b4364d79
commit
4487d6a4c2
|
@ -10,8 +10,6 @@ var acceptableCodeClasses =
|
||||||
"profile", "python", "r", "rib", "rsl", "ruby", "rust", "scala", "smalltalk", "sql", "tex", "text",
|
"profile", "python", "r", "rib", "rsl", "ruby", "rust", "scala", "smalltalk", "sql", "tex", "text",
|
||||||
"vala", "vbscript", "vhdl"];
|
"vala", "vbscript", "vhdl"];
|
||||||
|
|
||||||
var textCodeClasses = ["text", "pre"];
|
|
||||||
|
|
||||||
function flattenBlocks(blocks) {
|
function flattenBlocks(blocks) {
|
||||||
var result = "";
|
var result = "";
|
||||||
blocks.forEach(function(b) {
|
blocks.forEach(function(b) {
|
||||||
|
@ -30,13 +28,8 @@ Discourse.Dialect.replaceBlock({
|
||||||
if (matches[1] && acceptableCodeClasses.indexOf(matches[1]) !== -1) {
|
if (matches[1] && acceptableCodeClasses.indexOf(matches[1]) !== -1) {
|
||||||
klass = matches[1];
|
klass = matches[1];
|
||||||
}
|
}
|
||||||
|
|
||||||
if (textCodeClasses.indexOf(matches[1]) !== -1) {
|
|
||||||
return ['p', ['pre', ['code', flattenBlocks(blockContents) ]]];
|
|
||||||
} else {
|
|
||||||
return ['p', ['pre', ['code', {'class': klass}, flattenBlocks(blockContents) ]]];
|
return ['p', ['pre', ['code', {'class': klass}, flattenBlocks(blockContents) ]]];
|
||||||
}
|
}
|
||||||
}
|
|
||||||
});
|
});
|
||||||
|
|
||||||
// Ensure that content in a code block is fully escaped. This way it's not white listed
|
// Ensure that content in a code block is fully escaped. This way it's not white listed
|
||||||
|
|
Loading…
Reference in New Issue