Discourse markdown plugin error

AI-generated summary

The Discourse markdown plugin for adding ruby text is throwing a 500 Internal Server Error. aiong reported that the error occurs every time someone tries to post, regardless of whether the post contains ruby text ({...|...}). The error message [PrettyText] BAD MARKDOWN CALLBACK FOUND suggests that the plugin is not properly hooked into discourse-markdown-it. pmusaraj pointed out that the error is related to the discourse-markdown-it engine and that the plugin likely needs to be updated. Despite updating the markdown-it-ruby plugin to the latest version, the issue persists.

Refer to the initial post for more details on the error and the plugin configuration. pmusaraj provided a link to the relevant code in the discourse-markdown-it repository, which may help in resolving the issue.

Started POST "/posts" for 172.17.0.1 at 2024-11-25 22:17:41 +0000
Processing by PostsController#create as JSON
  Parameters: {"raw"=>"updated ruby plugin\n\ntesting ruby:\n\n{汝|lí}{好|hó}", "unlist_topic"=>"false", "category"=>"3", "topic_id"=>"71", "is_warning"=>"false", "archetype"=>"regular", "typing_duration_msecs"=>"200", "composer_open_duration_msecs"=>"2658", "featured_link"=>"", "shared_draft"=>"false", "draft_key"=>"topic_71", "nested_post"=>"true"}
[PrettyText] BAD MARKDOWN CALLBACK FOUND
[PrettyText] FEATURE IS: md-ruby
Completed 500 Internal Server Error in 76ms (ActiveRecord: 0.0ms | Allocations: 4230)
  • The error is thrown whether or not there is any ruby text ({...|...}) in the post.
  • This post https://meta.discourse.org/t/discourse-markdown-extensions-not-working-after-latest-discourse-upgrade/294155/1 seemed to have a similar issue, but I updated the extension to .js and it did not get fixed.
  • I also updated the markdown-it-ruby plugin to the latest version 1.1.1 by copying the plugin into the file /assets/javascripts/vendor/markdown-it-ruby.js in my repo.

Thanks in advance. Sorry for the links, I can only post 2.

That line points to:

https://github.com/discourse/discourse/blob/main/app/assets/javascripts/discourse-markdown-it/src/engine.js#L40

The plugin likely needs to be updated to properly hook the discourse-markdown-it.