1
0
mirror of synced 2026-05-23 18:03:15 +00:00

FIX: prefers textContent over innerText (#111)

This commit is contained in:
Joffrey JAFFEUX
2025-06-30 20:57:34 +02:00
committed by GitHub
parent 7ffdfb6cb4
commit 58d8505f99
2 changed files with 24 additions and 1 deletions
@@ -61,7 +61,7 @@ function decorate(elem, isPreview) {
const mathScript = document.createElement("script");
mathScript.type = type;
mathScript.innerText = elem.innerText;
mathScript.innerText = elem.textContent;
const mathWrapper = document.createElement(tag);
mathWrapper.classList.add(classList.split(" "));
+23
View File
@@ -0,0 +1,23 @@
# frozen_string_literal: true
RSpec.describe "Discourse Math - post", type: :system do
fab!(:current_user) { Fabricate(:admin) }
before do
SiteSetting.discourse_math_enabled = true
sign_in(current_user)
end
it "works with details" do
post =
create_post(
user: current_user,
raw: "This is maths:\n\n[details='math']\n$E=mc^2$\n[/details]",
)
visit(post.topic.url)
find("#post_1 details").click
expect(page).to have_selector("#MJXc-Node-6", text: "2")
end
end