FIX: correctly enables features of discourse-math (#73)

Prior to this fix discourse-math would not correctly be cooked in chat messages.
This commit is contained in:
Joffrey JAFFEUX 2023-08-14 23:24:13 +02:00 committed by GitHub
parent 0d8f41759f
commit 529ad1fe6d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 1 deletions

View File

@ -13,5 +13,9 @@ register_asset "stylesheets/ext/discourse-chat.scss"
enabled_site_setting :discourse_math_enabled
after_initialize do
chat&.enable_markdown_feature("discourse-math") if respond_to?(:chat) && SiteSetting.chat_enabled
if respond_to?(:chat) && SiteSetting.chat_enabled
chat&.enable_markdown_feature("discourse-math")
chat&.enable_markdown_feature("math")
chat&.enable_markdown_feature("asciimath") if SiteSetting.discourse_math_enable_asciimath
end
end