Skip to content

Fix pasting and cmd insertion into the SupSub block of a MathFunction.#44

Open
drgrice1 wants to merge 1 commit intoopenwebwork:mainfrom
drgrice1:update-dependencies-plus-mathfunction-issues
Open

Fix pasting and cmd insertion into the SupSub block of a MathFunction.#44
drgrice1 wants to merge 1 commit intoopenwebwork:mainfrom
drgrice1:update-dependencies-plus-mathfunction-issues

Conversation

@drgrice1
Copy link
Copy Markdown
Member

The SubSub block is supposed to only allow a SubSub (i.e., a subscript or superscript) to be entered. Anything else should move to the function parameter block and be inserted there. However, if something is pasted from the clipboard or the API cmd method is used to insert a latex command (as is done by the PG mqeditor toolbar), then that is being allowed in the SupSub block. So this fixes those cases to only allow SupSubs as should be the case. Anything else gets moves into the parameter block.

Note that this is built on top of #42. Also, this has not yet been published. You can test this with webwork2 and PG by cloning this pull request branch, running npm install, npm run build, and npm link, and then in the pg/htdocs directory running npm link @openwebwork/mathquill. Note that to test the cmd case with the mqeditor toolbar you will need to do this.

I will publish this to npm once merged.

@drgrice1 drgrice1 force-pushed the update-dependencies-plus-mathfunction-issues branch 4 times, most recently from 60a897e to f1857da Compare April 27, 2026 14:25
The SubSub block is supposed to only allow a SubSub (i.e., a subscript
or superscript) to be entered.  Anything else should move to the
function parameter block and be inserted there.  However, if something
is pasted from the clipboard or the API `cmd` method is used to insert a
latex command (as is done by the PG mqeditor toolbar), then that is
being allowed in the SupSub block.  So this fixes those cases to only
allow SupSubs as should be the case.  Anything else gets moves into the
parameter block.
@drgrice1 drgrice1 force-pushed the update-dependencies-plus-mathfunction-issues branch from f1857da to be44d5f Compare April 28, 2026 21:48
@pstaabp
Copy link
Copy Markdown
Member

pstaabp commented Apr 28, 2026

I think I have it set up correctly, but am trying to test this. Can you clarify what was not working or how to test. Is this nesting of button templates?

@drgrice1
Copy link
Copy Markdown
Member Author

Type log in the MathQuill input. After typing that the cursor will be blinking before the parenthesis in the "SupSub" block where you are only supposed to be able to type a superscript or a subscript. Then paste something there. It will be inserted there with the main branch and should not be. With this pull request it will go inside the parentheses where it should go.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants