Skip to content

Legacy Shortcodes with Separate Opener/Closer can be corrupted #2016

@ChristopherChudzicki

Description

@ChristopherChudzicki

Steps to reproduce

  1. Visit a page with separate opening/closing shortcode tags in OCW Studio. For example https://ocw-studio-rc.odl.mit.edu/sites/20-109-laboratory-fundamentals-in-biological-engineering-spring-2010/type/page/edit/84e8174c-592f-f934-08b5-8921e05ba894
  2. In CKEditor, Delete just the closing shortcode (or just the opening shortcode). For example, /anchor
  3. Publish the course

Actual result: Course fails to publish

Expected result: May need discussion, but whatever it is, publishing shouldn't break.

Context

We have several "legacy shortcodes". These are shortcodes that were introduced during the migration from old ocw in order to keep supporting functionality that existed in the old system but which we do not fully support in the new system.

An example is {{<anchor name href >}} text {{</anchor>}} shortcode. This shortcode enables creation of named anchors to support linking to specific parts of a page. We do not support creating or editing this shortcode in OCW Studio, but our intention was to support editing of other content in the same page without corrupting the shortcode. (See #1013)

However, we do allow deleting legacy shortcodes. And our CKEditor plugin treats openers and closers as separate shortcodes. Consequently, you can delete just the closer {{< /anchor >}} (or just the opener). This results in an unbuildable course.

Screenshot 2023-11-01 at 3 35 17 PM

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions