discourse/plugins/discourse-math/plugin.rb
Jarek Radosz e372355fd0
DEV: Clean up scope resolution operators in plugins (#34979)
Co-authored-by: Loïc Guitaut <loic@discourse.org>
2025-09-30 14:36:34 +02:00

24 lines
721 B
Ruby

# frozen_string_literal: true
# name: discourse-math
# about: Uses MathJax 203 or KaTeX 97 to render math expressions.
# meta_topic_id: 65770
# version: 0.9
# authors: Sam Saffron (sam)
# url: https://github.com/discourse/discourse/tree/main/plugins/discourse-math
register_asset "stylesheets/common/discourse-math.scss"
register_asset "stylesheets/ext/discourse-chat.scss"
enabled_site_setting :discourse_math_enabled
module ::DiscourseMath
end
after_initialize do
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