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

Images inside lists will break if edited in Studio CKEditor #1211

Open
ChristopherChudzicki opened this issue Apr 7, 2022 · 1 comment
Open
Labels
bug Something isn't working

Comments

@ChristopherChudzicki
Copy link
Contributor

ChristopherChudzicki commented Apr 7, 2022

TLDR: There are some pages with images inside lists. If you edit them in studio, the list gets messed up.

Steps to Reproduce

  1. View https://ocw-studio-rc.odl.mit.edu/sites/6-542j-laboratory-on-the-physiology-acoustics-and-perception-of-speech-fall-2005/type/page/edit/10bc4420-56a8-8eaf-011f-1e0381b8f295/?q=database

  2. And the currently published version https://ocwnext-rc.odl.mit.edu/courses/6-542j-laboratory-on-the-physiology-acoustics-and-perception-of-speech-fall-2005/pages/lab-database/ which has images inside a list (the linguistic symbols are images)

    Screen Shot 2022-04-07 at 11 38 17 AM
  3. Save the current markdown somewhere... here is the admin panel for that page: https://ocw-studio-rc.odl.mit.edu/admin/websites/websitecontent/554617/change/?_changelist_filters=q%3D10bc4420-56a8-8eaf-011f-1e0381b8f295

  4. Make a trivial edit to the page in studio, re-publish, and view the list again.

Expected Behavior

Trivial edit should not mess up the images in the list.

Actual Behavior

Images in the list are all messed up

Screen Shot 2022-04-07 at 11 46 49 AM

@ChristopherChudzicki
Copy link
Contributor Author

ChristopherChudzicki commented Apr 7, 2022

@pdpinch @dseaton I think this falls in the category of "Unexpected consequences of studio editing"...

In the particular case above, a good solution would be to re-author using some sort of text symbol instead of images. Here's another example (though, as discussed, those java visualizations don't work https://ocw.mit.edu/courses/8-02-physics-ii-electricity-and-magnetism-spring-2007/pages/visualizations/electrostatics/).

  • Images inside lists cannot be created currently in studio. This is only an issue for migrated content.

    In terms of how widespread this pattern is in existing content... I am not sure, but I think there are at least 300 instances of images inside un-ordered lists (based on searching markdown with a regex like '(?<!\*)\*[^\n\*]*({{< resource|\[!)).

  • This is really a CKEditor issue, not a markdown / shortcode issue... Supporting images inside lists with CKEditor is more-or-less impossible at the moment, but should be possible (with some effort) once CKEditor v34 is released. Implement advanced lists (document lists) ckeditor/ckeditor5#2973 (comment)

@ChristopherChudzicki ChristopherChudzicki added the bug Something isn't working label Apr 7, 2022
@ChristopherChudzicki ChristopherChudzicki changed the title Images inside lists will break if edited in CK Editor. Images inside lists will break if edited in Studio CKEditor Apr 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant