Scratchaddons: Better quoter addon can quote any and all text on page, should include bbcode as well.

Created on 4 Jan 2021  路  2Comments  路  Source: ScratchAddons/ScratchAddons

Describe the bug

When using the better-quoter addon, you can select any text on the page and then press any quote button, and the selected text will be quoted. In addition (this should probably be a separate issue), this addon should include the correct bbcode of the quoted text, as scratch's native quoter does. There should also be an optional option to automatically close bbcode tags when quoting, but again, that's another issue.

To Reproduce

  1. Go to any non-closed forum topic
  2. select any amount of text from anywhere on the page
  3. click any quote button on the page
  4. you will see that all of the selected text will be quoted, and there will be no bbcode from any posts you selected.

Expected behavior

It should either not do anything if you try to quote things outside of a post, just quote the original post or just quote the part that is selected inside the post.
The selected post's bbcode should be included in the quote.

Screenshots

Device (please complete the following information):

  • OS: windows 10
  • Browser: chrome 87
  • Version: sa 1.7.0-prerelease

Additional context

I should be able to fix this (if someone could assign me that would be nice). But there are a couple of options, either one of those as detailed in expected behaviour, or we could do what discourse does and add a little quote button next to the end of the selected text if it's all in one post, and use that to quote small parts, and the usual button to quote as normal. This makes the most sense to me.
Regarding the bbcode, we can fetch https://scratch.mit.edu/post/POST_ID/source to get the bbcode of it, and then figure out where about the person has selected it and then go from there... tbh that's not really viable but oh well.
This will require a complete revamp of this addon.

addon bug

Most helpful comment

Regarding the bbcode, we can fetch https://scratch.mit.edu/post/POST_ID/source to get the bbcode of it, and then figure out where about the person has selcted it and then go from there... tbh that's not really viable but oh well.

Reversing the HTML would be much easier and, more importantly, would always produce valid BBCode.

All 2 comments

Regarding the bbcode, we can fetch https://scratch.mit.edu/post/POST_ID/source to get the bbcode of it, and then figure out where about the person has selcted it and then go from there... tbh that's not really viable but oh well.

Reversing the HTML would be much easier and, more importantly, would always produce valid BBCode.

For 2, see #1219. The user can click the button and use that to get the BBCode

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Touchcreator picture Touchcreator  路  3Comments

WorldLanguages picture WorldLanguages  路  7Comments

RedGuy12 picture RedGuy12  路  5Comments

WorldLanguages picture WorldLanguages  路  8Comments

WorldLanguages picture WorldLanguages  路  10Comments