Page MenuHomePhabricator
Paste P9393

(An Untitled Masterwork)
ActivePublic

Authored by Arlolra on Oct 18 2019, 7:41 PM.
diff --git a/lib/ext/Poem/index.js b/lib/ext/Poem/index.js
index 7c93a16f3..a233b0ea6 100644
--- a/lib/ext/Poem/index.js
+++ b/lib/ext/Poem/index.js
@@ -34,11 +34,12 @@ const toDOM = Promise.async(function *(state, content, args) {
.replace(/^(-+)<\/poem>/mg, '$1\n');
}).join('');
// Replace colons with indented spans
- content = content.replace(/^(:+)(.+)$/g, function(match, colons, verse) {
+ content = content.replace(/^(:+)(.+)$/gm, function(match, colons, verse) {
const span = dummyDoc.createElement('span');
span.setAttribute('class', 'mw-poem-indented');
span.setAttribute('style', 'display: inline-block; margin-left: ' + colons.length + 'em;');
- span.appendChild(dummyDoc.createTextNode(verse));
+ // span.appendChild(dummyDoc.createTextNode(verse));
+ span.innerHTML = verse; // FIXME: Is this safe?
return span.outerHTML;
});
}