GithubHelp home page GithubHelp logo

rpnation / bbcode Goto Github PK

View Code? Open in Web Editor NEW
1.0 2.0 3.0 1.08 MB

RpNation's Official BBCode Implementation for Discourse

License: GNU General Public License v3.0

JavaScript 86.27% Ruby 1.48% Handlebars 0.31% SCSS 11.91% Shell 0.03%

bbcode's Introduction

BBCode

RpNation's Official BBCode Implementation for Discourse

See: [https://www.rpnation.com]

The goal of this repo and plugin is to provide users with the BBCode suite that they have grown accustomed to when it comes to using our site before our migration to Discourse and make sure that old posts rebake correctly. Above in the chart is marked our status on each BBCode which will hopefully co-exist in tandom even with the markdown/htlm versions provided in the box experience by the Discourse Software.

Features/Planned

Ⓜ️ = The BBCode also has a markdown version

🚧 = In progress or needs CSS.

⌨️ = BBCode also has an HTML equivalent.

🎉 = Powered by official Discourse Addon.

☠️ = Do not proceed. BBob, Markdown, and/or Discourse do not like this code. Unable to be rebaked.

General

  • Refactor stylesheets to fit common discourse styling variables

Text Formatting

  • Headers & Sub-Headers Ⓜ️
  • Highlights
  • Justified Text
  • Blockquotes
  • Sub Script ⌨️
  • Super Script ⌨️
  • Google Font Library
  • HTML Comment⌨️
  • Paragraph Indent
  • Bold, Italic, Underline, Strikethrough Ⓜ️
  • Color
  • Font Size
  • Left, Center, Right
  • Spoiler
  • Line Break
  • NOBR/No Line Break
  • Inline Spoiler

Layout & Design

  • Dividers
  • Image Float
  • Fieldsets
  • Sides
  • Tabs
  • Accordions
  • Tables now using markdown tables
  • Center Block
  • Background
  • Border
  • Scroll Box
  • Div Box
  • Anchors
  • Rows & Columns

Media & Embeds

  • Google Docs(PDF) Switching to native iframes.
  • Height Restrict
  • Image
  • Challonge - Add as an iframe supported site in settings instead.

Aesthetics

  • Print
  • Text Message
  • Blocks
  • Progress Bar
  • Sticky Note
  • Mail
  • Newspaper
  • Checks
  • Font Awesome Icons
  • OOC

Credit

❤️ to Nikolay Kost (JiLiZART) for BBob GitHub - JiLiZART/BBob: ⚡️Blazing-fast js-bbcode-parser, bbcode js, that transforms and parses to AST with plugin support in pure javascript, no dependencies

Steps to start local Discourse docker

Inside the discourse directory, run

d/boot_dev -p

d/ember-cli -u

To kill the container

d/shutdown_dev

For more, see the Discourse Docker Guide

Architecture

The architecture of this project is for all BBCode Parser related code to be contained in /bbcode-src, which would then be minified into a module and added to the appropriate location in /assets/javascripts to be used by the discourse plugin proper. This is to work around the weird way discourse requires libraries to be loaded in. There will be a Rollup config and github action setup to automate minifying and moving the module.

Honestly, if anyone has a better solution, please send help.

bbcode's People

Contributors

alteras1 avatar mshultz avatar blythechan avatar kyuukestu avatar mondrethos avatar kelliver avatar rhababo avatar

Stargazers

 avatar

Watchers

 avatar  avatar

bbcode's Issues

BBCode Tag: Code, icode, plain

add [code], [icode], [plain] bbcode tag.

  • translate to markdown backtick for easy processing?
  • add support to md code block and inline code to prevent processing by BBob

Refactor highlight tag

Update this file
For consistency, I want to refactor the highlight .js file to follow the export standard we have with other single-tag.js files. This way, we can also remove the spreader syntax from preset.js

Rebake Error

Failed to rebake (topic_id: 93, post_id: 160)
TypeError: Cannot read properties of undefined (reading 'toLowerCase')
JavaScript at fenceCodeBlockPreprocess (<anonymous>:2371:52)
JavaScript at preprocessRaw (<anonymous>:2400:23)
JavaScript at RpNBBCode (<anonymous>:2421:48)
JavaScript at preprocessor (discourse/plugins/bbcode/lib/discourse-markdown/bbcode-plugin:23:23)
JavaScript at engine.render (discourse/plugins/bbcode/lib/discourse-markdown/bbcode-plugin:67:42)
JavaScript at cook (discourse-markdown-it/engine:58:37)
JavaScript at DiscourseMarkdownIt.cook (discourse-markdown-it/index:55:33)
JavaScript at <anonymous>:1:6
/var/www/discourse/vendor/bundle/ruby/3.2.0/gems/mini_racer-0.9.0/lib/mini_racer.rb:228:in `eval_unsafe'
/var/www/discourse/vendor/bundle/ruby/3.2.0/gems/mini_racer-0.9.0/lib/mini_racer.rb:228:in `block (2 levels) in eval'
/var/www/discourse/vendor/bundle/ruby/3.2.0/gems/mini_racer-0.9.0/lib/mini_racer.rb:369:in `timeout'
/var/www/discourse/vendor/bundle/ruby/3.2.0/gems/mini_racer-0.9.0/lib/mini_racer.rb:227:in `block in eval'
/var/www/discourse/vendor/bundle/ruby/3.2.0/gems/mini_racer-0.9.0/lib/mini_racer.rb:225:in `synchronize'
/var/www/discourse/vendor/bundle/ruby/3.2.0/gems/mini_racer-0.9.0/lib/mini_racer.rb:225:in `eval'
/var/www/discourse/lib/pretty_text.rb:236:in `block in markdown'
/var/www/discourse/lib/pretty_text.rb:676:in `block in protect'
/var/www/discourse/lib/pretty_text.rb:676:in `synchronize'
/var/www/discourse/lib/pretty_text.rb:676:in `protect'
/var/www/discourse/lib/pretty_text.rb:174:in `markdown'
/var/www/discourse/lib/pretty_text.rb:299:in `cook'
/var/www/discourse/app/models/post_analyzer.rb:30:in `cook'
/var/www/discourse/app/models/post.rb:347:in `cook'
/var/www/discourse/app/models/post.rb:778:in `rebake!'
/var/www/discourse/lib/tasks/posts.rake:145:in `rebake_post'
/var/www/discourse/lib/tasks/posts.rake:132:in `block (2 levels) in rebake_posts'
/var/www/discourse/vendor/bundle/ruby/3.2.0/gems/activerecord-7.0.8.1/lib/active_record/relation/delegation.rb:88:in `each'
/var/www/discourse/vendor/bundle/ruby/3.2.0/gems/activerecord-7.0.8.1/lib/active_record/relation/delegation.rb:88:in `each'
/var/www/discourse/lib/tasks/posts.rake:131:in `block in rebake_posts'
/var/www/discourse/vendor/bundle/ruby/3.2.0/gems/activesupport-7.0.8.1/lib/active_support/core_ext/range/each.rb:14:in `step'
/var/www/discourse/vendor/bundle/ruby/3.2.0/gems/activesupport-7.0.8.1/lib/active_support/core_ext/range/each.rb:14:in `step'
/var/www/discourse/lib/tasks/posts.rake:126:in `rebake_posts'
/var/www/discourse/lib/tasks/posts.rake:111:in `block in rebake_posts_all_sites'
/var/www/discourse/vendor/bundle/ruby/3.2.0/gems/rails_multisite-6.0.0/lib/rails_multisite/connection_management/null_instance.rb:49:in `with_connection'
/var/www/discourse/vendor/bundle/ruby/3.2.0/gems/rails_multisite-6.0.0/lib/rails_multisite/connection_management/null_instance.rb:36:in `each_connection'
/var/www/discourse/vendor/bundle/ruby/3.2.0/gems/rails_multisite-6.0.0/lib/rails_multisite/connection_management.rb:21:in `each_connection'
/var/www/discourse/lib/tasks/posts.rake:111:in `rebake_posts_all_sites'
/var/www/discourse/lib/tasks/posts.rake:7:in `block in <main>'
/var/www/discourse/vendor/bundle/ruby/3.2.0/gems/rake-13.2.1/lib/rake/task.rb:281:in `block in execute'
/var/www/discourse/vendor/bundle/ruby/3.2.0/gems/rake-13.2.1/lib/rake/task.rb:281:in `each'
/var/www/discourse/vendor/bundle/ruby/3.2.0/gems/rake-13.2.1/lib/rake/task.rb:281:in `execute'
/var/www/discourse/vendor/bundle/ruby/3.2.0/gems/rake-13.2.1/lib/rake/task.rb:219:in `block in invoke_with_call_chain'
/var/www/discourse/vendor/bundle/ruby/3.2.0/gems/rake-13.2.1/lib/rake/task.rb:199:in `synchronize'
/var/www/discourse/vendor/bundle/ruby/3.2.0/gems/rake-13.2.1/lib/rake/task.rb:199:in `invoke_with_call_chain'
/var/www/discourse/vendor/bundle/ruby/3.2.0/gems/rake-13.2.1/lib/rake/task.rb:188:in `invoke'
/var/www/discourse/vendor/bundle/ruby/3.2.0/gems/rake-13.2.1/lib/rake/application.rb:188:in `invoke_task'
/var/www/discourse/vendor/bundle/ruby/3.2.0/gems/rake-13.2.1/lib/rake/application.rb:138:in `block (2 levels) in top_level'
/var/www/discourse/vendor/bundle/ruby/3.2.0/gems/rake-13.2.1/lib/rake/application.rb:138:in `each'
/var/www/discourse/vendor/bundle/ruby/3.2.0/gems/rake-13.2.1/lib/rake/application.rb:138:in `block in top_level'
/var/www/discourse/vendor/bundle/ruby/3.2.0/gems/rake-13.2.1/lib/rake/application.rb:147:in `run_with_threads'
/var/www/discourse/vendor/bundle/ruby/3.2.0/gems/rake-13.2.1/lib/rake/application.rb:132:in `top_level'
/var/www/discourse/vendor/bundle/ruby/3.2.0/gems/rake-13.2.1/lib/rake/application.rb:83:in `block in run'
/var/www/discourse/vendor/bundle/ruby/3.2.0/gems/rake-13.2.1/lib/rake/application.rb:214:in `standard_exception_handling'
/var/www/discourse/vendor/bundle/ruby/3.2.0/gems/rake-13.2.1/lib/rake/application.rb:80:in `run'
bin/rake:13:in `<top (required)>'
/usr/local/lib/ruby/gems/3.2.0/gems/bundler-2.5.3/lib/bundler/cli/exec.rb:58:in `load'
/usr/local/lib/ruby/gems/3.2.0/gems/bundler-2.5.3/lib/bundler/cli/exec.rb:58:in `kernel_load'
/usr/local/lib/ruby/gems/3.2.0/gems/bundler-2.5.3/lib/bundler/cli/exec.rb:23:in `run'
/usr/local/lib/ruby/gems/3.2.0/gems/bundler-2.5.3/lib/bundler/cli.rb:451:in `exec'
/usr/local/lib/ruby/gems/3.2.0/gems/bundler-2.5.3/lib/bundler/vendor/thor/lib/thor/command.rb:28:in `run'
/usr/local/lib/ruby/gems/3.2.0/gems/bundler-2.5.3/lib/bundler/vendor/thor/lib/thor/invocation.rb:127:in `invoke_command'
/usr/local/lib/ruby/gems/3.2.0/gems/bundler-2.5.3/lib/bundler/vendor/thor/lib/thor.rb:527:in `dispatch'
/usr/local/lib/ruby/gems/3.2.0/gems/bundler-2.5.3/lib/bundler/cli.rb:34:in `dispatch'
/usr/local/lib/ruby/gems/3.2.0/gems/bundler-2.5.3/lib/bundler/vendor/thor/lib/thor/base.rb:584:in `start'
/usr/local/lib/ruby/gems/3.2.0/gems/bundler-2.5.3/lib/bundler/cli.rb:28:in `start'
/usr/local/lib/ruby/gems/3.2.0/gems/bundler-2.5.3/exe/bundle:28:in `block in <top (required)>'
/usr/local/lib/ruby/gems/3.2.0/gems/bundler-2.5.3/lib/bundler/friendly_errors.rb:117:in `with_friendly_errors'
/usr/local/lib/ruby/gems/3.2.0/gems/bundler-2.5.3/exe/bundle:20:in `<top (required)>'
/usr/local/bin/bundle:25:in `load'
/usr/local/bin/bundle:25:in `<main>'
      246 / 356 ( 69.1%)
Failed to rebake (topic_id: 64, post_id: 111)
TypeError: Cannot read properties of undefined (reading 'toLowerCase')
JavaScript at fenceCodeBlockPreprocess (<anonymous>:2371:52)
JavaScript at preprocessRaw (<anonymous>:2400:23)
JavaScript at RpNBBCode (<anonymous>:2421:48)
JavaScript at preprocessor (discourse/plugins/bbcode/lib/discourse-markdown/bbcode-plugin:23:23)
JavaScript at engine.render (discourse/plugins/bbcode/lib/discourse-markdown/bbcode-plugin:67:42)
JavaScript at cook (discourse-markdown-it/engine:58:37)
JavaScript at DiscourseMarkdownIt.cook (discourse-markdown-it/index:55:33)
JavaScript at <anonymous>:1:6
/var/www/discourse/vendor/bundle/ruby/3.2.0/gems/mini_racer-0.9.0/lib/mini_racer.rb:228:in `eval_unsafe'
/var/www/discourse/vendor/bundle/ruby/3.2.0/gems/mini_racer-0.9.0/lib/mini_racer.rb:228:in `block (2 levels) in eval'
/var/www/discourse/vendor/bundle/ruby/3.2.0/gems/mini_racer-0.9.0/lib/mini_racer.rb:369:in `timeout'
/var/www/discourse/vendor/bundle/ruby/3.2.0/gems/mini_racer-0.9.0/lib/mini_racer.rb:227:in `block in eval'
/var/www/discourse/vendor/bundle/ruby/3.2.0/gems/mini_racer-0.9.0/lib/mini_racer.rb:225:in `synchronize'
/var/www/discourse/vendor/bundle/ruby/3.2.0/gems/mini_racer-0.9.0/lib/mini_racer.rb:225:in `eval'
/var/www/discourse/lib/pretty_text.rb:236:in `block in markdown'
/var/www/discourse/lib/pretty_text.rb:676:in `block in protect'
/var/www/discourse/lib/pretty_text.rb:676:in `synchronize'
/var/www/discourse/lib/pretty_text.rb:676:in `protect'
/var/www/discourse/lib/pretty_text.rb:174:in `markdown'
/var/www/discourse/lib/pretty_text.rb:299:in `cook'
/var/www/discourse/app/models/post_analyzer.rb:30:in `cook'
/var/www/discourse/app/models/post.rb:347:in `cook'
/var/www/discourse/app/models/post.rb:778:in `rebake!'
/var/www/discourse/lib/tasks/posts.rake:145:in `rebake_post'
/var/www/discourse/lib/tasks/posts.rake:132:in `block (2 levels) in rebake_posts'
/var/www/discourse/vendor/bundle/ruby/3.2.0/gems/activerecord-7.0.8.1/lib/active_record/relation/delegation.rb:88:in `each'
/var/www/discourse/vendor/bundle/ruby/3.2.0/gems/activerecord-7.0.8.1/lib/active_record/relation/delegation.rb:88:in `each'
/var/www/discourse/lib/tasks/posts.rake:131:in `block in rebake_posts'
/var/www/discourse/vendor/bundle/ruby/3.2.0/gems/activesupport-7.0.8.1/lib/active_support/core_ext/range/each.rb:14:in `step'
/var/www/discourse/vendor/bundle/ruby/3.2.0/gems/activesupport-7.0.8.1/lib/active_support/core_ext/range/each.rb:14:in `step'
/var/www/discourse/lib/tasks/posts.rake:126:in `rebake_posts'
/var/www/discourse/lib/tasks/posts.rake:111:in `block in rebake_posts_all_sites'
/var/www/discourse/vendor/bundle/ruby/3.2.0/gems/rails_multisite-6.0.0/lib/rails_multisite/connection_management/null_instance.rb:49:in `with_connection'
/var/www/discourse/vendor/bundle/ruby/3.2.0/gems/rails_multisite-6.0.0/lib/rails_multisite/connection_management/null_instance.rb:36:in `each_connection'
/var/www/discourse/vendor/bundle/ruby/3.2.0/gems/rails_multisite-6.0.0/lib/rails_multisite/connection_management.rb:21:in `each_connection'
/var/www/discourse/lib/tasks/posts.rake:111:in `rebake_posts_all_sites'
/var/www/discourse/lib/tasks/posts.rake:7:in `block in <main>'
/var/www/discourse/vendor/bundle/ruby/3.2.0/gems/rake-13.2.1/lib/rake/task.rb:281:in `block in execute'
/var/www/discourse/vendor/bundle/ruby/3.2.0/gems/rake-13.2.1/lib/rake/task.rb:281:in `each'
/var/www/discourse/vendor/bundle/ruby/3.2.0/gems/rake-13.2.1/lib/rake/task.rb:281:in `execute'
/var/www/discourse/vendor/bundle/ruby/3.2.0/gems/rake-13.2.1/lib/rake/task.rb:219:in `block in invoke_with_call_chain'
/var/www/discourse/vendor/bundle/ruby/3.2.0/gems/rake-13.2.1/lib/rake/task.rb:199:in `synchronize'
/var/www/discourse/vendor/bundle/ruby/3.2.0/gems/rake-13.2.1/lib/rake/task.rb:199:in `invoke_with_call_chain'
/var/www/discourse/vendor/bundle/ruby/3.2.0/gems/rake-13.2.1/lib/rake/task.rb:188:in `invoke'
/var/www/discourse/vendor/bundle/ruby/3.2.0/gems/rake-13.2.1/lib/rake/application.rb:188:in `invoke_task'
/var/www/discourse/vendor/bundle/ruby/3.2.0/gems/rake-13.2.1/lib/rake/application.rb:138:in `block (2 levels) in top_level'
/var/www/discourse/vendor/bundle/ruby/3.2.0/gems/rake-13.2.1/lib/rake/application.rb:138:in `each'
/var/www/discourse/vendor/bundle/ruby/3.2.0/gems/rake-13.2.1/lib/rake/application.rb:138:in `block in top_level'
/var/www/discourse/vendor/bundle/ruby/3.2.0/gems/rake-13.2.1/lib/rake/application.rb:147:in `run_with_threads'
/var/www/discourse/vendor/bundle/ruby/3.2.0/gems/rake-13.2.1/lib/rake/application.rb:132:in `top_level'
/var/www/discourse/vendor/bundle/ruby/3.2.0/gems/rake-13.2.1/lib/rake/application.rb:83:in `block in run'
/var/www/discourse/vendor/bundle/ruby/3.2.0/gems/rake-13.2.1/lib/rake/application.rb:214:in `standard_exception_handling'
/var/www/discourse/vendor/bundle/ruby/3.2.0/gems/rake-13.2.1/lib/rake/application.rb:80:in `run'
bin/rake:13:in `<top (required)>'
/usr/local/lib/ruby/gems/3.2.0/gems/bundler-2.5.3/lib/bundler/cli/exec.rb:58:in `load'
/usr/local/lib/ruby/gems/3.2.0/gems/bundler-2.5.3/lib/bundler/cli/exec.rb:58:in `kernel_load'
/usr/local/lib/ruby/gems/3.2.0/gems/bundler-2.5.3/lib/bundler/cli/exec.rb:23:in `run'
/usr/local/lib/ruby/gems/3.2.0/gems/bundler-2.5.3/lib/bundler/cli.rb:451:in `exec'
/usr/local/lib/ruby/gems/3.2.0/gems/bundler-2.5.3/lib/bundler/vendor/thor/lib/thor/command.rb:28:in `run'
/usr/local/lib/ruby/gems/3.2.0/gems/bundler-2.5.3/lib/bundler/vendor/thor/lib/thor/invocation.rb:127:in `invoke_command'
/usr/local/lib/ruby/gems/3.2.0/gems/bundler-2.5.3/lib/bundler/vendor/thor/lib/thor.rb:527:in `dispatch'
/usr/local/lib/ruby/gems/3.2.0/gems/bundler-2.5.3/lib/bundler/cli.rb:34:in `dispatch'
/usr/local/lib/ruby/gems/3.2.0/gems/bundler-2.5.3/lib/bundler/vendor/thor/lib/thor/base.rb:584:in `start'
/usr/local/lib/ruby/gems/3.2.0/gems/bundler-2.5.3/lib/bundler/cli.rb:28:in `start'
/usr/local/lib/ruby/gems/3.2.0/gems/bundler-2.5.3/exe/bundle:28:in `block in <top (required)>'
/usr/local/lib/ruby/gems/3.2.0/gems/bundler-2.5.3/lib/bundler/friendly_errors.rb:117:in `with_friendly_errors'
/usr/local/lib/ruby/gems/3.2.0/gems/bundler-2.5.3/exe/bundle:20:in `<top (required)>'
/usr/local/bin/bundle:25:in `load'
/usr/local/bin/bundle:25:in `<main>'
      249 / 356 ( 69.9%)
Failed to rebake (topic_id: 64, post_id: 108)
TypeError: Cannot read properties of undefined (reading 'toLowerCase')
JavaScript at fenceCodeBlockPreprocess (<anonymous>:2371:52)
JavaScript at preprocessRaw (<anonymous>:2400:23)
JavaScript at RpNBBCode (<anonymous>:2421:48)
JavaScript at preprocessor (discourse/plugins/bbcode/lib/discourse-markdown/bbcode-plugin:23:23)
JavaScript at engine.render (discourse/plugins/bbcode/lib/discourse-markdown/bbcode-plugin:67:42)
JavaScript at cook (discourse-markdown-it/engine:58:37)
JavaScript at DiscourseMarkdownIt.cook (discourse-markdown-it/index:55:33)
JavaScript at <anonymous>:1:6
/var/www/discourse/vendor/bundle/ruby/3.2.0/gems/mini_racer-0.9.0/lib/mini_racer.rb:228:in `eval_unsafe'
/var/www/discourse/vendor/bundle/ruby/3.2.0/gems/mini_racer-0.9.0/lib/mini_racer.rb:228:in `block (2 levels) in eval'
/var/www/discourse/vendor/bundle/ruby/3.2.0/gems/mini_racer-0.9.0/lib/mini_racer.rb:369:in `timeout'
/var/www/discourse/vendor/bundle/ruby/3.2.0/gems/mini_racer-0.9.0/lib/mini_racer.rb:227:in `block in eval'
/var/www/discourse/vendor/bundle/ruby/3.2.0/gems/mini_racer-0.9.0/lib/mini_racer.rb:225:in `synchronize'
/var/www/discourse/vendor/bundle/ruby/3.2.0/gems/mini_racer-0.9.0/lib/mini_racer.rb:225:in `eval'
/var/www/discourse/lib/pretty_text.rb:236:in `block in markdown'
/var/www/discourse/lib/pretty_text.rb:676:in `block in protect'
/var/www/discourse/lib/pretty_text.rb:676:in `synchronize'
/var/www/discourse/lib/pretty_text.rb:676:in `protect'
/var/www/discourse/lib/pretty_text.rb:174:in `markdown'
/var/www/discourse/lib/pretty_text.rb:299:in `cook'
/var/www/discourse/app/models/post_analyzer.rb:30:in `cook'
/var/www/discourse/app/models/post.rb:347:in `cook'
/var/www/discourse/app/models/post.rb:778:in `rebake!'
/var/www/discourse/lib/tasks/posts.rake:145:in `rebake_post'
/var/www/discourse/lib/tasks/posts.rake:132:in `block (2 levels) in rebake_posts'
/var/www/discourse/vendor/bundle/ruby/3.2.0/gems/activerecord-7.0.8.1/lib/active_record/relation/delegation.rb:88:in `each'
/var/www/discourse/vendor/bundle/ruby/3.2.0/gems/activerecord-7.0.8.1/lib/active_record/relation/delegation.rb:88:in `each'
/var/www/discourse/lib/tasks/posts.rake:131:in `block in rebake_posts'
/var/www/discourse/vendor/bundle/ruby/3.2.0/gems/activesupport-7.0.8.1/lib/active_support/core_ext/range/each.rb:14:in `step'
/var/www/discourse/vendor/bundle/ruby/3.2.0/gems/activesupport-7.0.8.1/lib/active_support/core_ext/range/each.rb:14:in `step'
/var/www/discourse/lib/tasks/posts.rake:126:in `rebake_posts'
/var/www/discourse/lib/tasks/posts.rake:111:in `block in rebake_posts_all_sites'
/var/www/discourse/vendor/bundle/ruby/3.2.0/gems/rails_multisite-6.0.0/lib/rails_multisite/connection_management/null_instance.rb:49:in `with_connection'
/var/www/discourse/vendor/bundle/ruby/3.2.0/gems/rails_multisite-6.0.0/lib/rails_multisite/connection_management/null_instance.rb:36:in `each_connection'
/var/www/discourse/vendor/bundle/ruby/3.2.0/gems/rails_multisite-6.0.0/lib/rails_multisite/connection_management.rb:21:in `each_connection'
/var/www/discourse/lib/tasks/posts.rake:111:in `rebake_posts_all_sites'
/var/www/discourse/lib/tasks/posts.rake:7:in `block in <main>'
/var/www/discourse/vendor/bundle/ruby/3.2.0/gems/rake-13.2.1/lib/rake/task.rb:281:in `block in execute'
/var/www/discourse/vendor/bundle/ruby/3.2.0/gems/rake-13.2.1/lib/rake/task.rb:281:in `each'
/var/www/discourse/vendor/bundle/ruby/3.2.0/gems/rake-13.2.1/lib/rake/task.rb:281:in `execute'
/var/www/discourse/vendor/bundle/ruby/3.2.0/gems/rake-13.2.1/lib/rake/task.rb:219:in `block in invoke_with_call_chain'
/var/www/discourse/vendor/bundle/ruby/3.2.0/gems/rake-13.2.1/lib/rake/task.rb:199:in `synchronize'
/var/www/discourse/vendor/bundle/ruby/3.2.0/gems/rake-13.2.1/lib/rake/task.rb:199:in `invoke_with_call_chain'
/var/www/discourse/vendor/bundle/ruby/3.2.0/gems/rake-13.2.1/lib/rake/task.rb:188:in `invoke'
/var/www/discourse/vendor/bundle/ruby/3.2.0/gems/rake-13.2.1/lib/rake/application.rb:188:in `invoke_task'
/var/www/discourse/vendor/bundle/ruby/3.2.0/gems/rake-13.2.1/lib/rake/application.rb:138:in `block (2 levels) in top_level'
/var/www/discourse/vendor/bundle/ruby/3.2.0/gems/rake-13.2.1/lib/rake/application.rb:138:in `each'
/var/www/discourse/vendor/bundle/ruby/3.2.0/gems/rake-13.2.1/lib/rake/application.rb:138:in `block in top_level'
/var/www/discourse/vendor/bundle/ruby/3.2.0/gems/rake-13.2.1/lib/rake/application.rb:147:in `run_with_threads'
/var/www/discourse/vendor/bundle/ruby/3.2.0/gems/rake-13.2.1/lib/rake/application.rb:132:in `top_level'
/var/www/discourse/vendor/bundle/ruby/3.2.0/gems/rake-13.2.1/lib/rake/application.rb:83:in `block in run'
/var/www/discourse/vendor/bundle/ruby/3.2.0/gems/rake-13.2.1/lib/rake/application.rb:214:in `standard_exception_handling'
/var/www/discourse/vendor/bundle/ruby/3.2.0/gems/rake-13.2.1/lib/rake/application.rb:80:in `run'
bin/rake:13:in `<top (required)>'
/usr/local/lib/ruby/gems/3.2.0/gems/bundler-2.5.3/lib/bundler/cli/exec.rb:58:in `load'
/usr/local/lib/ruby/gems/3.2.0/gems/bundler-2.5.3/lib/bundler/cli/exec.rb:58:in `kernel_load'
/usr/local/lib/ruby/gems/3.2.0/gems/bundler-2.5.3/lib/bundler/cli/exec.rb:23:in `run'
/usr/local/lib/ruby/gems/3.2.0/gems/bundler-2.5.3/lib/bundler/cli.rb:451:in `exec'
/usr/local/lib/ruby/gems/3.2.0/gems/bundler-2.5.3/lib/bundler/vendor/thor/lib/thor/command.rb:28:in `run'
/usr/local/lib/ruby/gems/3.2.0/gems/bundler-2.5.3/lib/bundler/vendor/thor/lib/thor/invocation.rb:127:in `invoke_command'
/usr/local/lib/ruby/gems/3.2.0/gems/bundler-2.5.3/lib/bundler/vendor/thor/lib/thor.rb:527:in `dispatch'
/usr/local/lib/ruby/gems/3.2.0/gems/bundler-2.5.3/lib/bundler/cli.rb:34:in `dispatch'
/usr/local/lib/ruby/gems/3.2.0/gems/bundler-2.5.3/lib/bundler/vendor/thor/lib/thor/base.rb:584:in `start'
/usr/local/lib/ruby/gems/3.2.0/gems/bundler-2.5.3/lib/bundler/cli.rb:28:in `start'
/usr/local/lib/ruby/gems/3.2.0/gems/bundler-2.5.3/exe/bundle:28:in `block in <top (required)>'
/usr/local/lib/ruby/gems/3.2.0/gems/bundler-2.5.3/lib/bundler/friendly_errors.rb:117:in `with_friendly_errors'
/usr/local/lib/ruby/gems/3.2.0/gems/bundler-2.5.3/exe/bundle:20:in `<top (required)>'
/usr/local/bin/bundle:25:in `load'
/usr/local/bin/bundle:25:in `<main>'
      356 / 356 (100.0%)
356 posts done!

Discourse Plugin naming scheme and stylesheet

So I figured out why we're unable to load in stylesheets. It seems discourse expects the plugin name to be lowercase letters.

I did some manual editing on my local system to change the root dir of the plugin from BBCode to just bbcode and re linked everything together and the stylesheets got loaded in.

Taking a quick roster of the available discourse plugins, it looks like everyone follows a lowercase hyphen naming convention.

We should rename the repo since the repo name is generally the default name of the root dir. Thankfully we caught this early on, and should be able to replace every mention of bbcode to the new name without much trouble

I propose something like discourse-bbcode? Might be a bit too generic...

Case insensitive tags

BBob doesn't seem to support case insensitive tags. Might need to make suggestion/open PR on BBob's repo. Could also consider removing the allowed tags mode and do a custom bbob plugin to walk the tree similar to how we already do with newlines.

BBCode Tag Workarounds

Due to how the built in markdown engine processes inline and block level bbcodes, some specific tag orders aren't supported.

For example:
image

likely workaround would be to just add those simple default tags (italic, bold, underline, etc.) manually ourselves to the BBob plugin.

Add alt tags for functionality supported by Markdown in Discourse

So folks have block and inline options where they want them as well as richer backwards compatibility, we'll be adding in tags for the rudimentary text formatting options we'll be providing markdown alternatives for.

  1. Bold [b]
  2. Italic [i]
  3. Underline [u]
  4. Strikethrough [s]
  5. Headers and Subheaders [h] [sh]

Update: It looks like b,i,u, and s may already be implemented. So for now we're just focusing on headers and subheaders for this one.

Whitespace changes persisting when quoted

This is an issue for later down the line, but I noticed that if you highlight and quote text using the "quote" popup in discourse, it trims newlines and extra whitespace when propagating that text into the composer.

Screenshot 2023-09-23 at 11 03 12 AM

I'm not sure how discourse propagates the quote into the composer, so there may be something that we would need to intercept/override.

BBCode Tag: Mail

Add [mail][person][subject] bbcode tag

Note: CLEAN UP HTML & CSS

Alternative?: Instead of making a separate tag for person and subject, combine them all as options into the mail tag

[mail type="send" person="john doe" subject="hello world"]
lorem ipsum
[/mail]

https://www.rpnation.com/bbcode/post-2501892

Image unfurling is broken

I've tested it, and it works fine when you disable the whole plugin.

When you put a link to an image without Markdown formatting, the editor will unfurl it and display the image. That means that the cron (sidekiq) system will come within the next five minutes and download the image locally, as does the xenforo site.

This means that link.com will eventually become:

![name](link) and properly format all on its own.

This is critical for the import script since all [img] tags get stripped out.

Note: this is not me talking image links in bbcodes. To test just put a link to an image in a post while the plugin is uninstalled vs installed.

Fontawesome Source

@Alteras1,

On the live site, I believe we include the Fontawesome CDN at the top of the PAGE_HEADER Template and call it a day.

On discourse, we've been trialing on T since 2020 this plugin:

https://meta.discourse.org/t/discourse-fontawesome-pro/150871

Cons:

  • Only supports 5
  • Limited to Dev Support

Alternatives:

  • Download the CSS Project from the website with our pro license (but I don't think we can share it with our open source project?). We could add it as a theme component (repo) like the style component but private, to provide the CSS just for that.
  • We can use the CDN like we do currently on the live site.

What do we want to do with BBCodes that could become iframes

Hey,

So I was looking at the two BBCode that are not actually BBCode. PDF (using Google Drive links) Challenge while they have tags like BBCode, are actually a part of xenForo's media system which I have no idea why they did that way, I guess to try to make it all look like BBCode and leverage their engine, but whatever.

On Discourse, we can just do this:

image

In the above picture you can see all the default iframe source domains that discourse allows, and I've gone ahead and added drive.google.com

This means that

[gdoc]0B-8p7J_eRZNScUVXUzZNRFBnVEk[/gdoc] 

becomes

<iframe src="https://drive.google.com/file/d/0B-8p7J_eRZNScUVXUzZNRFBnVEk/preview?resourcekey=0-BbPZmK-7LK8LaCJnz7vvCA" width="640" height="480" allow="autoplay"></iframe>

This also means that users no longer have to hunt down for the ID in the URL or anything else. They can use the Google provided code for their posts and, in fact, the iframe code provided by any site we choose to allow in the future, like https://kumu.io

See it in action here: https://t.rpnation.com/t/testing-google-pdf/133

Testing and Documentation of BBScript

Due to the nature of BBScript, extra testing is needed. Requires full documentation of both bbscript1 and bbscript2.

This is required for complete adoption of changes in #117

Font Awesome Icon Picker

Future enhancement: create a font awesome icon picker that users can access via the editor toolbar.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.