Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CKEditor malfunctions with shortcodes following Markdown < symbol #2134

Open
HussainTaj-arbisoft opened this issue Mar 21, 2024 · 3 comments
Labels
bug Something isn't working product:ocw

Comments

@HussainTaj-arbisoft
Copy link
Contributor

Resource link's Studio UI breaks when they follow the < symbol.

Expected Behavior

CKEditor shows shortcode resource link UI for added links.

Current Behavior

CKEditor either does not show resource link UI or shows a HTML code equivalent of the shortcode. For example,

Screenshot 2024-03-21 at 7 27 20 PM

Steps to Reproduce

  1. Create a page.
  2. In markdown add <.
  3. Add a resource link via "Add Link" UI after the symbol.
  4. Click save.
  5. Open the saved page. Notice the broken (or completely disappeared) shortcode.

Examples

< -add link-
0 <= N <= 1000

-add link-

Possible Solution

We probably need to update the CKEditor plugin that parses shortcodes into CKEditor UI components.

Additional Details

Discovered in https://github.com/mitodl/hq/issues/3825

@HussainTaj-arbisoft HussainTaj-arbisoft added bug Something isn't working product:ocw labels Mar 21, 2024
@pdpinch
Copy link
Member

pdpinch commented Mar 21, 2024

@ChristopherChudzicki any quick takes on this?

@ChristopherChudzicki
Copy link
Contributor

I don't have any immediate insight regarding the root cause. Some thoughts:

Workarounds: The author could use mathjax for an immediate workaround. (Or possibly use inline code, 1 < 2, if it's appropriate in the context of the course. Inline code seems to work OK.)

Shortcodes aside, something weird is going on with <. See video below. I initially enter <, but end up getting \\\\\< after a few saves. This is without any shortcodes.

less_than_great.mov

@ibrahimjaved12
Copy link
Contributor

ibrahimjaved12 commented Mar 22, 2024

Shortcodes aside, something weird is going on with <. See video below. I initially enter <, but end up getting \\\\\< after a few saves. This is without any shortcodes.

less_than_great.mov

For some reason your example (without shortcodes) only works if we don't have any embedded images (also videos, I think) in the bottom.
If you have plain editor (without any added links), and an embedded picture in bottom, then your example won't work.
It will always work without the picture.

image image

One thing with embedded picture is, if they're in the end, they always add an extra newline in the bottom.
But if we have it in top, then the text breaks up.
image

But as long as we have in bottom (even if we have on top), then it does not break up.

However, either way, in any combination of these, if you add Resource Link , it does seem to either disappear or act weird.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working product:ocw
Projects
None yet
Development

No branches or pull requests

4 participants